Пример #1
0
        void Run()
        {
            ObjectStructure o = new ObjectStructure();
            o.Attach(new ConcreteElementA());
            o.Attach(new ConcreteElementB());

            ConcreteVistor1 v1 = new ConcreteVistor1();
            ConcreteVistor2 v2 = new ConcreteVistor2();

            o.Accept(v1);
            o.Accept(v2);
        }
Пример #2
0
        void Run()
        {
            ObjectStructure o = new ObjectStructure();

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

            ConcreteVistor1 v1 = new ConcreteVistor1();
            ConcreteVistor2 v2 = new ConcreteVistor2();

            o.Accept(v1);
            o.Accept(v2);
        }