protected bool ExecuteActionInternal(IUndoableAction action, bool clearRedoStack) { OnBeforeStateChanged(); if (!action.Execute()) { return(false); } if (clearRedoStack) { redoStack.Clear(); } var undoGroup = action.GetUndoGroup(); // Should we group together this undo step with more of the same kind? if (undoGroup != 0) { if (currentGroup == null || currentGroup.CaughtGroup != undoGroup) { currentGroup = new UndoableActionGroup(undoGroup); AddToUndoStack(currentGroup); } currentGroup.Actions.Add(action); } else { AddToUndoStack(action); } OnAfterStateChanged(); return(true); }
public void ExecuteAction(IUndoableAction action) { action.Execute(); Push(_undoStack, action); _redoStack.Clear(); EnforceLimit(); }
public void ExecuteAction(IUndoableAction action) { action.Execute(); Push(_undoStack, action); _redoStack.Clear(); EnforceLimit(); }
public void Execute(IUndoableAction action) { action.Execute(); Push(UndoStack, action); RedoStack.Clear(); }
public void Execute(IUndoableAction action) { action.Execute(); _undoableActions.Push(action); _redoableActions.Clear(); }