Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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();
     }
 }