public void executeUndo() //execute the command on the top of the undo stack { redoMessage = getUndoMessage(); //get the redo message ICmd cmd = undo.Pop(); //pop the command to undo from the undo stack redo.Push(cmd.Exec()); //execute the undo command and add it to the redo stack }
private void redoCellTextChangeToolStripMenuItem_Click(object sender, EventArgs e) { ICmd temp = mySpreadsheet.popRedo(); mySpreadsheet.AddUndo(temp.Exec()); undoCellTextChangeToolStripMenuItem.Enabled = true; }
//description: execute command on top of redo stack and push the inverse command onto the undo stack //parameter: //return: public void Redo() { ICmd redo = StackRedo.Pop(); StackUndo.Push(redo.Exec()); }
//description: execute command on top of undo stack and push the inverse command onto the redo stack //parameter: //return: public void Undo() { ICmd undo = StackUndo.Pop(); StackRedo.Push(undo.Exec()); }
public void executeRedo() //execute the command on the top of the redo stack { ICmd cmd = redo.Pop(); //pop the command to redo from the redo stack undo.Push(cmd.Exec()); //execute the redo command and add it to the undo stack }