internal void SelectEdges(IVisualNode activatedNode) { uint[] inputs = activatedNode.GetInputSlots(); uint[] outputs = activatedNode.GetOutputSlots(); if (null != inputs) selectedSlots.AddRange(inputs); if (null != outputs) selectedSlots.AddRange(outputs); foreach (uint slotId in selectedSlots) { foreach (VisualEdge visualEdge in edgeCollection.Values) { if (visualEdge.Selected) continue; if ((visualEdge.StartSlotId == slotId) || (visualEdge.EndSlotId == slotId)) { visualEdge.Selected = true; visualEdge.Compose(); } } } }
internal void DeleteEdgesConnectTo(IVisualNode visualNode) { uint[] inputs = visualNode.GetInputSlots(); uint[] outputs = visualNode.GetOutputSlots(); List<VisualEdge> edgesToRemove = new List<VisualEdge>(); if (inputs != null) { foreach (uint slotId in inputs) { foreach (VisualEdge visualEdge in edgeCollection.Values) { if (visualEdge.EndSlotId == slotId || visualEdge.StartSlotId == slotId) edgesToRemove.Add(visualEdge); } } } if (outputs != null) { foreach (uint slotId in outputs) { foreach (VisualEdge visualEdge in edgeCollection.Values) { if (visualEdge.EndSlotId == slotId || visualEdge.StartSlotId == slotId) edgesToRemove.Add(visualEdge); } } } foreach (VisualEdge edgeToDelete in edgesToRemove) DeleteEdge(edgeToDelete); }