static void Main(string[] args) { ObjectStruture obj = new ObjectStruture(); obj.Attach(new ConcreteElementA()); obj.Attach(new ConcreteElementB()); obj.Accept(new VisitorA()); Console.WriteLine("-----------------"); obj.Accept(new VisitorC()); Console.WriteLine("-----------------"); obj.Accept(new VisitorB()); Console.WriteLine("-----------------"); Console.ReadLine(); }