static void Main(string[] args) { var o = new ObjectStruture(); o.Anexar(new ConcreteElementA()); o.Anexar(new ConcreteElementB()); var v1 = new ConcreteVisitor1(); var v2 = new ConcreteVisitor2(); o.Accept(v1); o.Accept(v2); }
static void Main(string[] args) { ObjectStruture o = new ObjectStruture(); o.Anexar(new ConcreteElementA()); o.Anexar(new ConcreteElementB()); ConcretVisitor1 v1 = new ConcretVisitor1(); ConcreteVisitor2 v2 = new ConcreteVisitor2(); o.Aceept(v1); o.Aceept(v2); Console.ReadKey(); }