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); }
public override void VisitConcreteElementA(ConcreteElementA element) { throw new NotImplementedException(); }
public abstract void VisitConcreteElementA(ConcreteElementA element);
public void VisitConcreteElementA(ConcreteElementA visitable) { System.Console.WriteLine("ConcreteVisitor perform opetation on ConcreteElementA"); }