Example #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (radioButton1.Checked)
     {
         invoker = new Invoker();
         line    = new Line();
         invoker.SetCommand(new LineCommand(line));
         invoker.Run();
     }
     if (radioButton2.Checked)
     {
         invoker = new Invoker();
         ellipse = new Ellipse();
         invoker.SetCommand(new EllipseCommand(ellipse));
         invoker.Run();
     }
     if (radioButton3.Checked)
     {
         invoker = new Invoker();
         bezier  = new Bezier();
         invoker.SetCommand(new BezierCommand(bezier));
         invoker.Run();
     }
 }
Example #2
0
 public BezierCommand(Bezier bezier)
 {
     this.bezier = bezier;
 }