示例#1
0
 public void Visit(JoinShapes joinShapes)
 {
     sb.AppendLine("<figuras>");
     joinShapes.Left.Accept(this);
     joinShapes.Right.Accept(this);
     sb.AppendLine("</figuras>");
 }
示例#2
0
        static void Main(string[] args)
        {
            var shapes = new JoinShapes(
                left: new Circle(3),
                right: new Square(10));
            var sb = new StringBuilder();

            var print = new ShapePrint();

            print.Visit(shapes);
            Console.WriteLine(print.ToString());
        }