示例#1
0
        static void Main(string[] args)
        {
            NameRepository namesRepository = new NameRepository();

            for (IIterator iter = namesRepository.GetIterator(); iter.HasNext();)
            {
                String name = (String)iter.Next();
                Console.WriteLine("Name : " + name);
                Console.ReadKey();
            }
        }
示例#2
0
        static void Main()
        {
            NameRepository namesRepository = new NameRepository();

            IIterator iter = namesRepository.GetIterator();

            while (iter.HasNext())
            {
                string name = (string)iter.Next();
                Console.WriteLine("Name : " + name);
            }
        }
示例#3
0
        public static void Demo()
        {
            NameRepository nr = new NameRepository();

            //NameRepository.NameIterator ni = new NameRepository.NameIterator();
            for (Iterator i = nr.GetIterator(); i.HasNext();)
            {
                Console.WriteLine(i.Next());
            }

            Console.ReadLine();
        }