Beispiel #1
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);
        }
Beispiel #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);
        }
Beispiel #3
0
 abstract public void VisitTrangle(Trangle trangle);
Beispiel #4
0
 public override void VisitTrangle(Trangle trangle)
 {
     Console.WriteLine("Scaling Trangle");
 }
Beispiel #5
0
 public abstract void VisitTrangle(Trangle trangle);
Beispiel #6
0
 public override void VisitTrangle(Trangle trangle)
 {
     Console.WriteLine("Scaling Trangle");
 }