/// <summary> /// Redo the last undo operation. /// </summary> public void Redo() { if (this.redoStack.Count > 0) { UndoableCommand command = this.redoStack.Pop(); command.Execute(); this.undoStack.Push(command); } }
/// <summary> /// Redo the last undo operation. /// </summary> public void Redo() { if (this.redoStack.Count > 0) { UndoableCommand command = this.redoStack.Pop(); command.Execute(); this.undoStack.Push(command); this.eventManager.GetEvent <OperationExecutedInTimelineEvent>().Publish(null); } }
/// <summary> /// Executes the <see cref="UndoableCommand"/> passed. /// </summary> /// <param name="command">The command beign executed.</param> public void ExecuteCommand(UndoableCommand command) { command.Execute(); if (this.undoStack.Count == this.currentUndoLevel) { this.undoStack = new Stack <UndoableCommand>(this.undoStack.Take(this.undoStack.Count - 1)); } this.undoStack.Push(command); this.redoStack.Clear(); }
/// <summary> /// Executes the <see cref="UndoableCommand"/> passed. /// </summary> /// <param name="command">The command beign executed.</param> public void ExecuteCommand(UndoableCommand command) { command.Execute(); if (this.undoStack.Count == this.currentUndoLevel) { this.undoStack = new Stack <UndoableCommand>(this.undoStack.Take(this.undoStack.Count - 1)); } this.undoStack.Push(command); this.eventManager.GetEvent <OperationExecutedInTimelineEvent>().Publish(null); this.redoStack.Clear(); }