static void Main(string[] args)
        {
            Circle circle = new Circle();
            Trangle triangle = new Trangle();

            Visitor visitor = new DrawVisitor();

            circle.Accept(visitor);
            triangle.Accept(visitor);

            Visitor anotherVisitor = new ScaleVisitor();

            circle.Accept(anotherVisitor);
            triangle.Accept(anotherVisitor);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Circle  circle   = new Circle();
            Trangle triangle = new Trangle();

            Visitor visitor = new DrawVisitor();

            circle.Accept(visitor);
            triangle.Accept(visitor);

            Visitor anotherVisitor = new ScaleVisitor();

            circle.Accept(anotherVisitor);
            triangle.Accept(anotherVisitor);
        }