/// <summary> /// 记录当前操作 /// </summary> /// <param oldName="oldName">当前操作项</param> public void recordOper(SVRedoUndoItem item) { if (!isRecord) { return; } listItem.RemoveRange(index, listItem.Count - index); index++; listItem.Add(item); operChanged(); }
/// <summary> /// 执行恢复操作 /// </summary> public void Redo() { if (index >= listItem.Count) { return; } index++; SVRedoUndoItem item = listItem[index - 1]; item.ReDo(); UpdateOperator(); operChanged(); }
/// <summary> /// 执行撤销操作 /// </summary> public void Undo() { if (index <= 0) { return; } SVRedoUndoItem item = listItem[index - 1]; item.UnDo(); index--; UpdateOperator(); operChanged(); }