コード例 #1
0
        /// <summary>
        /// Gets an object which represents a Circle.
        /// </summary>
        /// <returns>An object which represents a square.</returns>
        public BaseShape GetCircle()
        {
            CircleShape defaultCircleShape = new CircleShape
            {
                ShapeIdentifire = ShapeIdGenerator.GenerateUniqued(),
                XPosition       = 50,
                YPosition       = 50,
                ShapeHeight     = 50,
                ShapeWidth      = 50,
                ShapeColor      = "Black"
            };

            return(defaultCircleShape);
        }
コード例 #2
0
        /// <summary>
        /// Gets an object which represents a Rectangle.
        /// </summary>
        /// <returns>An object which represents a square.</returns>
        public BaseShape GetRectangle()
        {
            BoxShape defaultRectangleShape = new BoxShape
            {
                ShapeIdentifire = ShapeIdGenerator.GenerateUniqued(),
                XPosition       = 0,
                YPosition       = 0,
                ShapeHeight     = 50,
                ShapeWidth      = 100,
                ShapeColor      = "Black"
            };

            return(defaultRectangleShape);
        }
コード例 #3
0
        /// <summary>
        /// Gets an object which represents a Line.
        /// </summary>
        /// <returns>An object which represents a square.</returns>
        public BaseShape GetLine()
        {
            LineShape defaultLineShape = new LineShape
            {
                ShapeIdentifire = ShapeIdGenerator.GenerateUniqued(),
                XPosition       = 0,
                YPosition       = 0,
                ShapeHeight     = 0,
                ShapeWidth      = 100,
                ShapeColor      = "Black"
            };

            return(defaultLineShape);
        }
コード例 #4
0
        /// <summary>
        /// Mimics data retrieved from a resource
        /// </summary>
        private void Seed()
        {
            BoxShape defaultSquareShape = new BoxShape
            {
                ShapeIdentifire = ShapeIdGenerator.GenerateUniqued(),
                XPosition       = 0,
                YPosition       = 0,
                ShapeHeight     = 50,
                ShapeWidth      = 50,
                ShapeColor      = "Black"
            };

            BoxShape defaultRectangleShape = new BoxShape
            {
                ShapeIdentifire = ShapeIdGenerator.GenerateUniqued(),
                XPosition       = 0,
                YPosition       = 0,
                ShapeHeight     = 50,
                ShapeWidth      = 100,
                ShapeColor      = "Black"
            };

            CircleShape defaultCircleShape = new CircleShape
            {
                ShapeIdentifire = ShapeIdGenerator.GenerateUniqued(),
                XPosition       = 50,
                YPosition       = 50,
                ShapeHeight     = 50,
                ShapeWidth      = 50,
                ShapeColor      = "Black"
            };

            CircleShape defaultEllipseShape = new CircleShape
            {
                ShapeIdentifire = ShapeIdGenerator.GenerateUniqued(),
                XPosition       = 50,
                YPosition       = 50,
                ShapeHeight     = 50,
                ShapeWidth      = 100,
                ShapeColor      = "Black"
            };

            TriangleShape defaultTriangleShape = new TriangleShape
            {
                ShapeIdentifire = ShapeIdGenerator.GenerateUniqued(),
                XPosition       = 50,
                YPosition       = 50,
                ShapeHeight     = 50,
                ShapeWidth      = 100,
                ShapeColor      = "Black"
            };

            LineShape defaultLineShape = new LineShape
            {
                ShapeIdentifire = ShapeIdGenerator.GenerateUniqued(),
                XPosition       = 0,
                YPosition       = 0,
                ShapeHeight     = 0,
                ShapeWidth      = 100,
                ShapeColor      = "Black"
            };

            this.shapeDatabase.Add("Square", defaultSquareShape);
            this.shapeDatabase.Add("Rectangle", defaultRectangleShape);
            this.shapeDatabase.Add("Circle", defaultCircleShape);
            this.shapeDatabase.Add("Ellipse", defaultEllipseShape);
            this.shapeDatabase.Add("Triangle", defaultTriangleShape);
            this.shapeDatabase.Add("Line", defaultLineShape);
        }