public bool Redo(int level) { for (int i = 0; i < level && RedoStack.Count > 0; i++) { IDataGridCommand idgCommand = RedoStack.Pop(); UndoStack.Push(idgCommand); idgCommand.Execute(); } return(RedoStack.Count > 0); }
public bool Undo(int level) { for (int i = 0; i < level && UndoStack.Count > 0; i++) { IDataGridCommand idgCommand = UndoStack.Pop(); RedoStack.Push(idgCommand); idgCommand.Rollback(); } return(UndoStack.Count > 0); }