Exemplo n.º 1
0
        private static void IteratorPatternDemo()
        {
            Console.WriteLine("=== Road Bikes ===");
            RoadBikeRange roadBikeRange = new RoadBikeRange();

            PrintIterator(roadBikeRange.GetEnumerator());
            Console.WriteLine("=== Mountain Bikes ===");
            MountainBikeRange mountainBike = new MountainBikeRange();

            PrintIterator(mountainBike.GetEnumerator());
        }
        private static void IteratorPatternDemo()
        {
            Console.WriteLine("=== Road Bikes ===");
            RoadBikeRange roadrange = new RoadBikeRange();

            Printiterator(roadrange.GetEnumerator());


            Console.WriteLine("===Mountain Bikes===");
            MountainBikeRange mountainrange = new MountainBikeRange();

            foreach (IBicycle bicycle in mountainrange.Range)
            {
                Console.WriteLine(bicycle);
            }
        }