public ICmd Exec() { var inverse = new MultiCmd(); for (int i = commands.Count - 1; i >= 0; i--) { inverse.commands.Add(commands[i].Exec()); } return(inverse); }
public void Redo() { // check if the redo stack is empty if (!this.RedoEmpty) { // pop the commands off of the redo stack MultiCmd commands = this.m_redos.Pop(); // push the commands onto the undo stack this.m_undos.Push(commands.Exec()); } }
// adds commands onto the undo stack public void AddUndo(MultiCmd undos) { // push the undos onto the undo stack this.m_undos.Push(undos); }