public void Redo() { if (redoStack.Count == 0) { return; } IUndoable <T> action = redoStack.Pop(); T obj = action.Redo(); if (ReferenceEquals(action, redoCleanAction)) { fileIsClean.OnNext(Unit.Default); } affectedObject.OnNext(obj); AddUndoInternal(action); if (redoStack.Count == 0) { NotifyRedoUnavailable(); } else { redoDescription.OnNext(redoStack.Peek().Description); } }
protected override void Execute() { if (_activeContent != null) { _activeContent.Redo(); } }
public bool Redo() { bool result = redoStack.Count > 0; if (result) { IUndoable c = redoStack.Pop(); undoStack.Push(c); c.Redo(); } return(result); }
/// <summary> /// If possible, redo the top action on the redo stack. /// The action is moved onto the undo stack. /// If not possible, throws an InvalidOperationException /// </summary> public void Redo() { if (!CanRedo) { throw new InvalidOperationException(); } IUndoable action = redos.Pop(); action.Redo(); undos.Push(action); if (savepoint.HasValue) { // it will now take one less redo to reach the savepoint savepoint--; } NotifyAllProps(); }
/// <summary> /// 执行一次重复操作 /// </summary> public void Redo(XUndoEventArgs args) { if (intPosition >= this.Count) { return; } bool back = bolLock; bolLock = true; try { intPosition++; IUndoable undo = this.Current; if (undo != null) { undo.Redo(args); } OnStateChanged(); } finally { bolLock = back; } }
public void Undo() { iud.Redo(); }