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 PerformDo()
            {
                if (!IsCustomPreState)
                {
                    StateOnUndo = new TaeUndoRestorableGraphState(Graph, ItemsToCapture);
                }

                DoAction?.Invoke();
                StateOnRedo?.RestoreState();
            }
Exemplo n.º 3
0
            public TaeUndoableAction(TaeEditAnimEventGraph graph, Action doAction, Action undoAction, TaeUndoRestorableGraphState customPreState)
            {
                Graph          = graph;
                ItemsToCapture = null;

                StateOnUndo      = customPreState;
                IsCustomPreState = true;
                ItemsToCapture   = new List <ITaeClonable>();

                DoAction   = doAction;
                UndoAction = undoAction;
            }
Exemplo n.º 4
0
 public void PerformUndo()
 {
     StateOnRedo = new TaeUndoRestorableGraphState(Graph, ItemsToCapture);
     UndoAction?.Invoke();
     StateOnUndo?.RestoreState();
 }