Exemple #1
0
        private GraphViewChange OnGraphViewChanged(GraphViewChange graphViewChange)
        {
            if (graphViewChange.elementsToRemove != null)
            {
                foreach (var elem in graphViewChange.elementsToRemove)
                {
                    if (elem is BaseNodeView nodeView)
                    {
                        _graph.RemoveNode(nodeView.Node);
                    }
                    if (elem is BaseConnectionView connectionView)
                    {
                        _graph.Disconnect(connectionView.Connection);
                    }
                }
            }

            return(graphViewChange);
        }