private static IEnumerable <RemoteSourceNode> FindRemoteSourceNodes(PlanNode node) { foreach (PlanNode Source in node.GetSources()) { foreach (RemoteSourceNode Item in FindRemoteSourceNodes(Source)) { yield return(Item); } } if (node is RemoteSourceNode) { yield return((RemoteSourceNode)node); } }
private IEnumerable <PlanNode> FindSources(PlanNode node, IEnumerable <PlanNodeId> nodeIds) { if (nodeIds.Contains(node.Id)) { yield return(node); } foreach (PlanNode Source in node.GetSources()) { foreach (PlanNode Item in FindSources(Source, nodeIds)) { yield return(Item); } } }