Exemple #1
0
 static void Main(string[] args)
 {
     MyDictionary<string, Auto> auto = new MyDictionary<string, Auto>();
     Auto car = new Auto();
     auto.Add("Car", car);
     auto["Car"].Name = "Audi";
     Console.WriteLine(auto["Car"].Name);
     Console.WriteLine();
     Console.ReadLine();
 }
Exemple #2
-1
 static void Main(string[] args)
 {
     MyDictionary<string, Auto> auto = new MyDictionary<string, Auto>();
     Auto car = new Auto();
     auto.Add("Audi", car);
     auto.Add("BMW", car);
     foreach (var s in auto)
     {
         Console.WriteLine(s.Key);
     }
     Console.WriteLine();
     Console.ReadLine();
 }