public static void Composite() { IShape line = new Line(0, 0, 1, 1); Console.WriteLine("Rendering Line"); line.RenderShape(); Console.WriteLine("Rendering Rectangle"); IShape Rectangle = new Rectangle(); Rectangle.RenderShape(); IShape complexShape = new ComplexShape(); ((ComplexShape)complexShape).AddShape(new Line(0, 1, 1, 1)); ((ComplexShape)complexShape).AddShape(new Line(0, 1, 1, 1)); ((ComplexShape)complexShape).AddShape(new Line(0, 1, 1, 1)); ((ComplexShape)complexShape).AddShape(new Line(0, 1, 1, 1)); ((ComplexShape)complexShape).AddShape(new Line(0, 1, 1, 1)); Console.WriteLine("Rendering Complex Shape"); complexShape.RenderShape(); }