Example #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);
            }
        }
Example #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();
        }