/// <summary> /// Creates a new instance of the <see cref="T:Highpoint.Sage.Utility.Exchange"/> class. /// </summary> /// <param name="exec">The exec.</param> public Exchange(IExecutive exec) { m_exec = exec; // TODO: Add a GracefulAbort(...) to IDetachableEventController. // exec.ExecutiveFinished +=new ExecutiveEvent(exec_ExecutiveFinished); m_ts = Hashtable.Synchronized(new Hashtable()); m_waitersToRead = new HashtableOfLists(); m_waitersToTake = new HashtableOfLists(); m_blockedPosters = new Hashtable(); }
public void TestSortedHTOLTemplate() { IComparer <String> strComp = Comparer <string> .Default; HashtableOfLists <string, string> htol = new HashtableOfLists <string, string>(strComp); htol.Add("Dog", "Collie"); htol.Add("Pig", "Pot-bellied"); htol.Add("Horse", "Clydesdale"); htol.Add("Horse", "Arabian"); htol.Add("Dog", "Chihuahua"); Console.WriteLine("\r\nSequential dump."); foreach (string str in htol) { Console.WriteLine(str); } Console.WriteLine("\r\nList dump."); foreach (string key in htol.Keys) { Console.WriteLine(key + " --> " + StringOperations.ToCommasAndAndedList(htol[key])); } htol.Remove("Horse", "Arabian"); htol.Remove("Horse", "Clydesdale"); Console.WriteLine("\r\nSequential dump."); foreach (string str in htol) { Console.WriteLine(str); } Console.WriteLine("\r\nList dump."); foreach (string key in htol.Keys) { Console.WriteLine(key + " --> " + StringOperations.ToCommasAndAndedList(htol[key])); } }
public void TestHTOL() { HashtableOfLists htol = new HashtableOfLists(); htol.Add("Dog", "Collie"); htol.Add("Pig", "Pot-bellied"); htol.Add("Horse", "Arabian"); htol.Add("Horse", "Clydesdale"); htol.Add("Dog", "Chihuahua"); Console.WriteLine("Test before removal..."); foreach (string str in htol) { Console.WriteLine(str); } htol.Remove("Horse", "Arabian"); htol.Remove("Horse", "Clydesdale"); foreach (string str in htol) { Console.WriteLine(str); } }
public HtolEnumerator(HashtableOfLists htol) { m_htol = htol; Reset(); }