示例#1
0
        public static void Main_Iterator()
        {
            var agg1 = new ConcreteAggregate1();
            var agg2 = new ConcreteAggregate2();
            var it1  = agg1.CreateIterator();
            var it2  = agg2.CreateIterator();

            //TOOD:统一方法遍历it1、it2

            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            Title.UpperIndent(Assembly.GetExecutingAssembly());

            Client client = new Client();

            var ag1 = new ConcreteAggregate1 <MenuItem>();
            var ag2 = new ConcreteAggregate2 <MenuItem>();

            client.Print(ag1);
            client.Print(ag2);
            client.Print(ag1);

            Title.BottonIndent();
        }