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); } }
public override void Redo() //取消復原動作 { _model.DeleteShape(_shapeIndex); }
public override void Undo() //復原 { _model.DeleteShape(_shapeIndex); _model.DisPoseFocusShape(); }