static List <IEdgeModel> GetEdgesToDelete(GraphModel graphModel, IGraphElementModel[] deletables, IReadOnlyCollection <INodeModel> nodesToDelete)
        {
            var edgesToDelete = new HashSet <IEdgeModel>(deletables.OfType <IEdgeModel>());

            foreach (var node in nodesToDelete.Where(n => n.ParentStackModel == null || !n.ParentStackModel.DelegatesOutputsToNode(out var lastNode) || !ReferenceEquals(lastNode, n)))
            {
                foreach (var portModel in node.GetPortModels())
                {
                    edgesToDelete.AddRange(graphModel.EdgesConnectedToPorts(portModel));
                }
            }
            return(edgesToDelete.ToList());
        }
Пример #2
0
        static List <IEdgeModel> GetEdgesToDelete(GraphModel graphModel, IGraphElementModel[] deletables, IReadOnlyCollection <INodeModel> nodesToDelete)
        {
            var edgesToDelete = new HashSet <IEdgeModel>(deletables.OfType <IEdgeModel>());

            foreach (var node in nodesToDelete)
            {
                foreach (var portModel in node.GetPortModels())
                {
                    edgesToDelete.AddRange(graphModel.EdgesConnectedToPorts(portModel));
                }
            }
            return(edgesToDelete.ToList());
        }