Example #1
0
 private void Form1_MouseMove(object sender, MouseEventArgs e)
 {
     if (history.Count != 0 && history.Peek().IsA("MoveByMouseCommand") == true)
     {
         try {
             MoveByMouseCommand m = (MoveByMouseCommand)history.Peek();
             m.execute(e);
             this.Refresh();
         }
         catch { }
     }
 }
Example #2
0
 private void Form1_MouseDown(object sender, MouseEventArgs e)
 {
     if (choosen == "Cursor")
     {
         MoveByMouseCommand m = (MoveByMouseCommand)commands["MoveByMouse"].clon();
         for (int i = 0; i < storage.getCount(); i++)
         {
             if (storage.getObject(i).IsMouseInObject(e) == true)
             {
                 m.addPoint(storage.getObject(i), e);
             }
         }
         history.Push(m);
     }
 }