/// <summary> /// If all nodes that the node outputs to are in scopes list. I.e., /// </summary> /// <param name="node"></param> /// <param name="scopes"></param> /// <returns></returns> private bool IsNodeInScope(NodeModel node, IEnumerable<NodeModel> scopes) { if (node is Symbol) { return false; } foreach (var index in Enumerable.Range(0, node.OutPortData.Count)) { HashSet<Tuple<int, NodeModel>> outputTuples = null; if (!node.TryGetOutput(index, out outputTuples)) { continue; } if (!outputTuples.All(t => scopes.Contains(t.Item2))) { return false; } } return true; }