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