예제 #1
0
        static void Main(string[] args)
        {
            ObjectStruture obj = new ObjectStruture();
            obj.Attach(new ConcreteElementA());
            obj.Attach(new ConcreteElementB());


            obj.Accept(new VisitorA());
            Console.WriteLine("-----------------");

            obj.Accept(new VisitorC());
            Console.WriteLine("-----------------");

            obj.Accept(new VisitorB());
            Console.WriteLine("-----------------");


            Console.ReadLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            ObjectStruture obj = new ObjectStruture();

            obj.Attach(new ConcreteElementA());
            obj.Attach(new ConcreteElementB());


            obj.Accept(new VisitorA());
            Console.WriteLine("-----------------");

            obj.Accept(new VisitorC());
            Console.WriteLine("-----------------");

            obj.Accept(new VisitorB());
            Console.WriteLine("-----------------");


            Console.ReadLine();
        }