/// <summary> /// Undoes the last done command /// </summary> internal void Undo() { if (DoneCommands.Count == 0) { return; } D_Command c = DoneCommands.Pop(); c.ExecuteReverse(); UndoneCommands.Push(c); }
/// <summary> /// Redoes the last undone command /// </summary> internal void Redo() { if (UndoneCommands.Count == 0) { return; } D_Command c = UndoneCommands.Pop(); c.Execute(); DoneCommands.Push(c); }
private void DoCommand(D_Command c) { UndoRedoC.Do(c); UpdateUndoRedoCommands(); }
/// <summary> /// Execute a command for the first time /// </summary> /// <param name="c">The new command</param> internal void Do(D_Command c) { c.Execute(); DoneCommands.Push(c); UndoneCommands.Clear(); }