Esempio n. 1
0
 public void AddShape(Shape targetShape, int shapeIndex) //增加Shape命令
 {
     if (!targetShape.IsAPoint)                          //可形成圖形 則新增命令
     {
         NewCommandExcute();
         _commands.Add(new AddShapeCommand(_model, targetShape, shapeIndex));
         targetShape.ResetLocationOfPaintPoint();
     }
     else //無法形成圖形 刪除點
     {
         _model.DeleteShape(shapeIndex);
     }
 }
Esempio n. 2
0
 public override void Redo() //取消復原動作
 {
     _model.DeleteShape(_shapeIndex);
 }
Esempio n. 3
0
 public override void Undo() //復原
 {
     _model.DeleteShape(_shapeIndex);
     _model.DisPoseFocusShape();
 }