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(ConcreteElementB element)
 {
     Console.WriteLine(  "ConcreteVisitorB visited ConcreteElementB : {0}", element.ID);
 }
Beispiel #3
0
 public abstract void Visit(ConcreteElementB element);