public IUndoRedo Exec() { var undoList = new UndoRedoCollection(Type); // add the inverse operation of every element to the undoList to be // returned and possibly [un/re]done later foreach (var ur in undoRedos) { undoList.Add(ur.Exec()); } return(undoList); }
// exec the current popped undo and then pop it onto the redo stack public void DoUndo() { UndoRedoCollection redo = (UndoRedoCollection)undos.Pop().Exec(); redos.Push(new UndoRedoCollection(redo.Type, redo)); }
public void AddUndo(UndoRedoCollection ur) { undos.Push(ur); }