static void Main(string[] args)
        {
            var shapes = new List<Shape>();
            shapes.Add(new Circle { Width = 100, Height = 100, Position = new Position { X = 50, Y = 50 } });
            shapes.Add(new Rectangle { Width = 100, Height = 50, Position = new Position { X = 100, Y = 100 } });

            var canvas = new Canvas();
            canvas.DrawShapes(shapes);
        }
示例#2
0
文件: Program.cs 项目: schan1992/box
        static void Main(string[] args)
        {
            var shapes = new List<Shape>();
            shapes.Add(new Circle());
            shapes.Add(new Rectangle());

            var canvas = new Canvas();
            canvas.DrawShapes(shapes);
        }
示例#3
0
        static void Main(string[] args)
        {

            var lstShapes = new List<Shape>();
            lstShapes.Add(new Circle());
           // lstShapes.Add(new Triangle { Widht = 5, Height = 10 });
            lstShapes.Add(new Rectangle { Widht = 5, Height = 15 });
            var canvas = new Canvas();

            canvas.DrawShape(lstShapes);

        }
示例#4
0
        static void Main(string[] args)
        {
            var shapes = new List<Shape>();
            //shapes.Add(new Shape { Width = 100, Height = 100, Type = ShapeType.Square});
            //shapes.Add(new Shape { Width = 100, Height = 30, Type = ShapeType.Hexagon});

            shapes.Add(new Circle());
            shapes.Add(new Hexagon());

            var canvas = new Canvas();

            canvas.DrawShapes(shapes);
        }