示例#1
0
文件: Form1.cs 项目: aisyluG/OOP_labs
 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 { }
     }
 }
示例#2
0
文件: Form1.cs 项目: aisyluG/OOP_labs
 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);
     }
 }