public void DetectEndOfNode(AbstractNodeViewModel node) { /// Check OutputConnectors Count foreach (var output in node.OutputConnectors) { if (output.AttachedConnections.Count != 0) { return; /// not end } } if (EndOfNodes.IndexOf(node) < 0) { EndOfNodes.Add(node); } }
private void SolveEndOfNode() { /// Check if longer at the End of Node foreach (AbstractNodeViewModel item in EndOfNodes) { foreach (var output in item.OutputConnectors) { if (output.AttachedConnections.Count != 0) { /// Node was not end RemoveRequestNodes.Add(item); } } } foreach (var removeitem in RemoveRequestNodes) { EndOfNodes.Remove(removeitem); } }