/// <summary> /// 撤销操作 /// </summary> /// <returns></returns> public OperationStack Undo() { IsRecording = false; var stack = UndoStack.Pop(); Undoing?.Invoke(stack.Item1, stack.Item2); RedoStack.Push(stack); Undone?.Invoke(stack.Item1, stack.Item2); IsRecording = true; return(stack.Item1); }
/// <summary> /// Called when before undoing. /// </summary> /// <param name="undoUnit">The undo unit.</param> public virtual void OnUndoing(IUndoUnit undoUnit) { Undoing?.Invoke(this, undoUnit); }