示例#1
0
        public static Shape GetShapeInstance(string type, int X, int Y, int height, int width, int lineWidth, Color color)
        {
            Shape shape;

            switch (type)
            {
            case "Elipse":
                shape = new Elipse(X, Y, height, width, lineWidth, color);
                break;

            case "Rectangle":
                shape = new Rectangle(X, Y, height, width, lineWidth, color);
                break;

            case "Fozy":
                shape = new Elipse(X, Y, height, width, lineWidth, color);
                break;

            case "RectangleRound":
                shape = new RectangleRound(X, Y, height, width, lineWidth, color);
                break;

            default:
                shape = new Line(X, Y, height, width, lineWidth, color);
                break;
            }
            return(shape);
        }
示例#2
0
 public static Shape GetShapeInstance(string type, int X, int Y, int height, int width, int lineWidth, Color color)
 {
     Shape shape;
     switch (type)
     {
         case "Elipse":
             shape = new Elipse(X, Y, height, width, lineWidth, color);
             break;
         case "Rectangle":
             shape = new Rectangle(X, Y, height, width, lineWidth, color);
             break;
         case "Fozy":
             shape = new Elipse(X, Y, height, width, lineWidth, color);
             break;
         case "RectangleRound":
             shape = new RectangleRound(X, Y, height, width, lineWidth, color);
             break;
         default:
             shape = new Line(X, Y, height, width, lineWidth, color);
             break;
     }
     return shape;
 }