Set 1using System; 2using System.Collections; 3namespace Utilities 4{ 5/**////<summary> 6/// Provide a collection that contains a group of unique 7/// objects. 8///</summary> 9publicclass Set 10{ 11private Hashtable h =new Hashtable(); 12/**////<summary> 13/// Return an enumerator for this set. 14///</summary> 15///<returns>An enumerator for this set</returns> 16public IEnumerator GetEnumerator() 17{ 18return h.Keys.GetEnumerator(); 19 } 20/**////<summary> 21/// Add the provided object to this set. 22///</summary> 23///<param name="o">the object to add</param> 24publicvoid Add(Object o) 25{ 26 h[o] =null; 27 } 28/**////<summary> 29/// Return true if the set contains the presented object. 30///</summary> 31///<param name="o">the object of curiosity</param> 32///<returns>true, if the set contains the presented object</returns> 33publicbool Contains(Object o) 34{ 35return h.Contains(o); 36 } 37 } 38}