Example #1
0
 public override Shape Clone()
 {
     ShapeCircle newShape = new ShapeCircle();
     newShape.Location = new Point(this.Location.X + 15, this.Location.Y + 15) ;
     newShape.Size = this.Size;
     newShape.painter.CopyProperties(ref this.painter);
     return newShape;
 }
Example #2
0
        public override Shape Clone()
        {
            ShapeCircle newShape = new ShapeCircle();

            newShape.Location = new Point(this.Location.X + 15, this.Location.Y + 15);
            newShape.Size     = this.Size;
            newShape.painter.CopyProperties(ref this.painter);
            return(newShape);
        }
Example #3
0
        public void AddShape(byte intShapeID)
        {
            switch (intShapeID)
            {
            case 0:     //Rectangle
                ShapeRectangle rect = new ShapeRectangle();
                rect.Location = new Point(50, 50);
                AddShape(rect);
                break;

            case 1:     //Triangle
                ShapeTriangle triangle = new ShapeTriangle();
                triangle.Location = new Point(50, 50);
                AddShape(triangle);
                break;

            case 2:
                ShapeCircle circle = new ShapeCircle();
                circle.Location = new Point(50, 50);
                AddShape(circle);
                break;

            case 3:
                ShapePolygon poly = new ShapePolygon();
                poly.Location = new Point(50, 50);
                AddShape(poly);
                break;

            case 4:
                ShapeLine line = new ShapeLine();
                line.Location = new Point(50, 50);
                AddShape(line);
                break;

            case 5:
                ShapeText text = new ShapeText();
                text.Location = new Point(50, 50);
                AddShape(text);
                break;

            default:
                throw new Exception("Could not find the associated shape type!");
            }
        }
Example #4
0
 public void AddShape(byte intShapeID)
 {
     switch (intShapeID)
     {
         case 0: //Rectangle
             ShapeRectangle rect = new ShapeRectangle();
             rect.Location = new Point(50, 50);
             AddShape(rect);
             break;
         case 1: //Triangle
             ShapeTriangle triangle = new ShapeTriangle();
             triangle.Location = new Point(50, 50);
             AddShape(triangle);
             break;
         case 2:
             ShapeCircle circle = new ShapeCircle();
             circle.Location = new Point(50, 50);
             AddShape(circle);
             break;
         case 3:
             ShapePolygon poly = new ShapePolygon();
             poly.Location = new Point(50, 50);
             AddShape(poly);
             break;
         case 4:
             ShapeLine line = new ShapeLine();
             line.Location = new Point(50, 50);
             AddShape(line);
             break;
         case 5:
             ShapeText text = new ShapeText();
             text.Location = new Point(50, 50);
             AddShape(text);
             break;
         default:
             throw new Exception("Could not find the associated shape type!");
     }
 }