Пример #1
0
        static void Main(string[] args)
        {
            NameRepository nameRepository = new NameRepository();
            IIterator      iterator       = nameRepository.GetIterator();

            while (iterator.HasNext())
            {
                string name = (string)iterator.Next();
                Console.WriteLine("Name : " + name);
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            NameRepository nameRepository = new NameRepository();

            for (IIterator iterator = nameRepository.GetIterator(); iterator.HasNext();)
            {
                string name = (string)iterator.Next();
                Console.WriteLine("Name is: " + name);
            }

            Console.ReadKey();
        }