public void Undo() { if (this.undostack.Count > 0) { IUndoableOperation undoableOperation = (IUndoableOperation)this.undostack.Pop(); this.redostack.Push(undoableOperation); undoableOperation.Undo(); this.OnActionUndone(); } }
/// <summary> /// Call this method to undo the last operation on the stack /// </summary> public void Undo() { if (undostack.Count > 0) { IUndoableOperation uedit = (IUndoableOperation)undostack.Pop(); redostack.Push(uedit); uedit.Undo(); OnActionUndone(); } }
public void Undo() { this.AssertNoUndoGroupOpen(); if (this.undostack.Count > 0) { IUndoableOperation undoableOperation = this.undostack.Pop(); this.redostack.Push(undoableOperation); undoableOperation.Undo(); this.OnActionUndone(); } }
/// <summary> /// Undoes the last operation. /// </summary> public void Undo() { AssertNoUndoGroupOpen(); if (undostack.Count > 0) { IUndoableOperation uedit = undostack.Pop(); redostack.Push(uedit); uedit.Undo(); OnActionUndone(); } }
internal void RunUndo(IUndoableOperation op) { if (op is IUndoableOperationWithContext opWithCtx) { opWithCtx.Undo(this); } else { op.Undo(); } }
internal void RunUndo(IUndoableOperation op) { IUndoableOperationWithContext opWithCtx = op as IUndoableOperationWithContext; if (opWithCtx != null) { opWithCtx.Undo(this); } else { op.Undo(); } }
/// <summary> /// Call this method to undo the last operation on the stack /// </summary> public void Undo() { if (undoGroupDepth != 0) { throw new InvalidOperationException("cannot perform Undo/Redo while undo group is open"); } if (undostack.Count > 0) { IUndoableOperation uedit = (IUndoableOperation)undostack.Pop(); redostack.Push(uedit); uedit.Undo(); OnActionUndone(); } }
/// <summary> /// Call this method to undo the last operation on the stack /// </summary> public void Undo() { while (undoGroupDepth != 0) // SSM 24.08.18 - грязный хак в попытке исправления ошибки с Ctrl-Z { EndUndoGroup(); } if (undoGroupDepth != 0) { throw new InvalidOperationException("cannot perform Undo/Redo while undo group is open"); } if (undostack.Count > 0) { IUndoableOperation uedit = (IUndoableOperation)undostack.Pop(); redostack.Push(uedit); uedit.Undo(); OnActionUndone(); } }
/// <summary> /// Call this method to undo the last operation on the stack /// </summary> public void Undo() { VerifyNoUndoGroupOpen(); if (undostack.Count > 0) { lastGroupDescriptor = null; acceptChanges = false; IUndoableOperation uedit = undostack.Pop(); redostack.Push(uedit); uedit.Undo(); acceptChanges = true; if (undostack.Count == 0) { NotifyPropertyChanged("CanUndo"); } if (redostack.Count == 1) { NotifyPropertyChanged("CanRedo"); } } }
/// <summary> /// Undoes the last operation. /// </summary> public void Undo() { AssertNoUndoGroupOpen(); if (InternalUndoStack.Count > 0) { IUndoableOperation operation = InternalUndoStack.DequeueHead(); InternalRedoStack.EnqueueHead(operation); operation.Undo(); OnOperationUndone(); if (InternalUndoStack.Count == 0) { OnPropertyChanged(new PropertyChangedEventArgs("CanUndo")); } if (InternalRedoStack.Count == 1) { OnPropertyChanged(new PropertyChangedEventArgs("CanRedo")); } EnforceSizeLimit(); } }
internal void RunUndo(IUndoableOperation op) { IUndoableOperationWithContext opWithCtx = op as IUndoableOperationWithContext; if (opWithCtx != null) opWithCtx.Undo(this); else op.Undo(); }