static void Main(string[] args) { PersonCollection myPeople = new PersonCollection(); myPeople["Homer"] = new Person("Homer", "Simpson", 40); myPeople["Marge"] = new Person("Marge", "Simpson", 38); Person homer = myPeople["Homer"]; Console.WriteLine(homer); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("***** Fun with Indexers *****\n"); PeopleCollection myPeople = new PeopleCollection(); myPeople["Homer"] = new Person("Homer", "Simpson", 40); myPeople["Marge"] = new Person("Marge", "Simpson", 38); Person homer = myPeople["Homer"]; Console.WriteLine(homer.ToString()); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("***** Fun with Indexers ****\n"); PersonCollection myPeople = new PersonCollection(); myPeople["Homer"] = new Person("Homer", "Simpson", 40); myPeople["Marge"] = new Person("Marge", "Simpson", 38); // Get "Homer" and print data. Person homer = myPeople["Homer"]; Console.WriteLine(homer.ToString()); Console.WriteLine(); MultiIndexerWithDataTable(); Console.ReadLine(); }