Пример #1
0
        public async override Task Undo(Action <UndoObject> cb)
        {
            if (graph != null)
            {
                graph.TryAndLoadGraphStack(stack);

                await Task.Delay(25);

                App.Current.Dispatcher.Invoke(() =>
                {
                    Tuple <string, Point, List <NodeConnection> > result = graph.RemoveNode(id);

                    if (result != null)
                    {
                        if (cb != null)
                        {
                            cb.Invoke(new DeleteNode(StackId, result.Item1, id, result.Item2, result.Item3, graph, stack));
                        }
                        return;
                    }

                    if (cb != null)
                    {
                        cb.Invoke(null);
                    }
                });

                return;
            }

            if (cb != null)
            {
                cb.Invoke(null);
            }
        }
Пример #2
0
            public void RemoveUIGraphNode(UIGraphNode node)
            {
                Graph.RemoveNode(node);

                DrawGraph(true);
            }
Пример #3
0
        public override UndoObject Redo()
        {
            if (graph != null)
            {
                Tuple <string, Point, List <Tuple <string, List <Nodes.NodeOutputConnection> > > > result = graph.RemoveNode(id);

                if (result != null)
                {
                    return(new UndoDeleteNode(StackId, result.Item1, result.Item2, result.Item3, graph));
                }
            }

            return(null);
        }