Esempio n. 1
0
        //konstruktor
        public People(Person[] peopleArray)
        {
            //kopiujemy tablicę ludzi, którą dostajemy w konstruktorze
            _people = new Person[peopleArray.Length];

            for (var i = 0; i < peopleArray.Length; i++)
            {
                _people[i] = peopleArray[i];
            }
        }
Esempio n. 2
0
 public PeopleEnum(Person[] people)
 {
     _people = people;
 }
Esempio n. 3
0
        static void Main()
        {
            Person[] peopleArray = new Person[3]
            {
                new Person("John", "Smith"),
                new Person("Jim", "Johnson"),
                new Person("Sue", "Rabon")

            };

            People peopleList = new People(peopleArray);
            foreach (Person p in peopleList)
            {
                Console.WriteLine(p.ToString());
            }

            Console.Read();
        }