Esempio n. 1
0
 private void drawAllToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Random rnd= new Random();
     ShapeC ellipse = new EllipseC(rnd.Next(50), rnd.Next(50), rnd.Next(150), rnd.Next(150));
     ShapeC rectangle = new RectangleC(rnd.Next(50), rnd.Next(50), rnd.Next(350), rnd.Next(150));
     ShapeC triangle = new TriangleC(rnd.Next(50), rnd.Next(50), rnd.Next(150), rnd.Next(150), rnd.Next(200), rnd.Next(200));
     ShapeC line = new LineC(rnd.Next(50), rnd.Next(50), rnd.Next(150), rnd.Next(350));
     ListOfShapes.Add(ellipse);
     ListOfShapes.Add(rectangle);
     ListOfShapes.Add(triangle);
     ListOfShapes.Add(line);
     foreach (ShapeC Shape in ListOfShapes)
     {
         Shape.Draw();
     }
 }
Esempio n. 2
0
 private void ellipseToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ShapeC ellipse = new EllipseC(100, 100, 60, 40);
     ellipse.Draw();
 }