public void NewActionCustomPreState(TaeUndoRestorableGraphState customPreState, Action doAction, Action undoAction) { RedoStack.Clear(); var newAction = new TaeUndoableAction(MainScreen.Graph, doAction, undoAction, customPreState); newAction.PerformDo(); UndoStack.Push(newAction); }
public void NewActionOptional(bool enableUndoOnAction, Action doAction, Action undoAction, List <ITaeClonable> captureItems) { if (enableUndoOnAction && MainScreen?.Graph != null) { RedoStack.Clear(); var newAction = new TaeUndoableAction(MainScreen.Graph, doAction, undoAction, captureItems); newAction.PerformDo(); UndoStack.Push(newAction); } else { doAction?.Invoke(); } }