Example #1
0
 /// <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();
 }
Example #2
0
        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]));
            }
        }
Example #3
0
        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);
            }
        }
Example #4
0
 public HtolEnumerator(HashtableOfLists htol)
 {
     m_htol = htol;
     Reset();
 }