/// ------------------------------------------------------------------------------------ /// <summary> /// End the undoable UOW and Undo everything. /// </summary> /// ------------------------------------------------------------------------------------ protected void UndoAll() { IActionHandler actionHandler = Cache.ActionHandlerAccessor; // This ends a UOW, but with no Commit. if (actionHandler.CurrentDepth > 0) { actionHandler.EndUndoTask(); } // Undo the UOW (or more than one of them, if the test made new ones). while (actionHandler.CanUndo()) { actionHandler.Undo(); } // Need to 'Commit' to clear out redo stack, // since nothing is really saved. actionHandler.Commit(); }