Exemplo n.º 1
0
        public static void Test()
        {
            ConcreteVisitor  visitor         = new ConcreteVisitor();
            ConcreteElementA elementA        = new ConcreteElementA();
            ConcreteElementB elementB        = new ConcreteElementB();
            ObjectStructure  objectStructure = new ObjectStructure();

            objectStructure.AddElement(elementA);
            objectStructure.AddElement(elementB);
            objectStructure.Accept(visitor);
        }
Exemplo n.º 2
0
 public override void VisitConcreteElementA(ConcreteElementA element)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 3
0
 public abstract void VisitConcreteElementA(ConcreteElementA element);
Exemplo n.º 4
0
 public void VisitConcreteElementA(ConcreteElementA visitable)
 {
     System.Console.WriteLine("ConcreteVisitor perform opetation on ConcreteElementA");
 }