Ejemplo n.º 1
0
        public void Print <T>(IAggregate <T> aggregate) where T : MenuItem
        {
            Console.WriteLine(new string('_', 20));
            var iterator = aggregate.GetIterator();

            while (iterator.IsDone())
            {
                Console.WriteLine(iterator.Current());
            }
            Console.WriteLine(new string('_', 20));
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            MyAg       collection = new MyAg();
            IAggregate my         = (IAggregate)collection;

            IIterator itterator = my.GetIterator();

            while (!itterator.IsDone)
            {
                Console.WriteLine(itterator.NextItem);
            }
            Console.ReadKey();
        }