コード例 #1
0
        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
ファイル: Program.cs プロジェクト: ChristianWoeber/VS2015
        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
ファイル: Program.cs プロジェクト: jimxshaw/samples-csharp
        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);
        }