Esempio n. 1
0
        public void Run()
        {
            var aggregage = new ConcreteAggregage();
            aggregage[0] = "apple";
            aggregage[1] = "apple2";
            aggregage[2] = "apple3";
            aggregage[3] = "apple4";

            var iterator = new ConcreteIterator(aggregage);

            object item = iterator.First();
            while (!iterator.IsDone()) {
                Console.WriteLine(item.ToString());
                item = iterator.MoveNext();

            }
        }
Esempio n. 2
0
 public ConcreteIterator(ConcreteAggregage aggregate)
 {
     _aggregate = aggregate;
 }