Beispiel #1
0
        public void Run()
        {
            var objectStructure = new ObjectStructure();

            ConcreteElementA elementa = new ConcreteElementA();
               elementa.Name="a";

               ConcreteElementB elementb = new ConcreteElementB();
               elementb.ID = "b";

            objectStructure.Attach(elementa);
            objectStructure.Attach(elementb);

            objectStructure.Accept(new ConcreteVisitorA());
            objectStructure.Accept(new ConcreteVisitorB());
        }
Beispiel #2
0
 public override void Visit(ConcreteElementA element)
 {
     Console.WriteLine( "ConcreteVisitorB visited ConcreteElementA : {0}",  element.Name);
 }
Beispiel #3
0
 public abstract void Visit(ConcreteElementA element);