Beispiel #1
0
        private static void dumpDictionary(LinkedHashtable table)
        {
            foreach (DictionaryEntry o in table)
            {
                Console.WriteLine(string.Format("Item: key={0} value={1}", o.Key, o.Value));
            }

            Console.WriteLine("keys are " + InspectCollection(table.Keys));
            Console.WriteLine("values are " + InspectCollection(table.Values));
        }
 private static void dumpDictionary(LinkedHashtable table)
 {
     foreach (DictionaryEntry o in table)
     {
         Console.WriteLine(string.Format("Item: key={0} value={1}", o.Key, o.Value));
     }
     
     Console.WriteLine("keys are " + InspectCollection(table.Keys));
     Console.WriteLine("values are " + InspectCollection(table.Values));
 }
        public void Test1()
        {
            LinkedHashtable table = new LinkedHashtable();
            table["Super"] = "Ayr";
            table["Ayr"] = "United";
            table["Fred"] = "Wilma";
            table["Dumbarton"] = "Gubbed";
            dumpDictionary(table);

            Console.WriteLine("\nRemoving XXX (non-existant)");
            table.Remove("XXX");
            dumpDictionary(table);

            Console.WriteLine("\nRemoving Fred");
            table.Remove("Fred");
            dumpDictionary(table);

            Console.WriteLine("\nMoving Dumbarton to head");
            table.MoveToHead("Dumbarton");
            dumpDictionary(table);
        }
Beispiel #4
0
        public void Test1()
        {
            LinkedHashtable table = new LinkedHashtable();

            table["Super"]     = "Ayr";
            table["Ayr"]       = "United";
            table["Fred"]      = "Wilma";
            table["Dumbarton"] = "Gubbed";
            dumpDictionary(table);

            Console.WriteLine("\nRemoving XXX (non-existant)");
            table.Remove("XXX");
            dumpDictionary(table);

            Console.WriteLine("\nRemoving Fred");
            table.Remove("Fred");
            dumpDictionary(table);

            Console.WriteLine("\nMoving Dumbarton to head");
            table.MoveToHead("Dumbarton");
            dumpDictionary(table);
        }
 public LHTEnumerator(LinkedHashtable container)
 {
     _container = container;
 }
 public LHTEnumerator(LinkedHashtable container)
 {
     _container = container;                
 }