Example #1
0
        public override void AddShape()
        {
            Point     point1    = new Point(int.Parse(Point1X.Text), int.Parse(Point1Y.Text));
            Rectangle rectangle = new Rectangle(point1, int.Parse(Width.Text), int.Parse(Height.Text));

            ShapesList.AddShape(rectangle);
            MessageBox.Show(@"Success");
            Clean();
        }
Example #2
0
 private void Activate(object sender, EventArgs e)
 {
     if (Figure != null)
     {
         Rectangle rectangle = (Rectangle)Figure;
         Point1X.Text = rectangle.Points[0].X.ToString();
         Point1Y.Text = rectangle.Points[1].Y.ToString();
         Width.Text   = Convert.ToString(rectangle.Points[1].X - rectangle.Points[0].X);
         Height.Text  = Convert.ToString(rectangle.Points[0].Y - rectangle.Points[2].Y);
     }
     else
     {
         Clean();
     }
 }