/// <summary> /// Returns all child nodes as a set. /// </summary> /// <param name="currentNode">parent node</param> /// <param name="filter">The filter.</param> /// <returns>all child nodes</returns> public static ICollection <EvalForgeNode> RecursiveGetChildNodes( EvalForgeNode currentNode, EvalNodeUtilFactoryFilter filter) { ICollection <EvalForgeNode> result = new LinkedHashSet <EvalForgeNode>(); if (filter.Consider(currentNode)) { result.Add(currentNode); } RecursiveGetChildNodes(result, currentNode, filter); return(result); }
private static void RecursiveGetChildNodes( ICollection <EvalForgeNode> set, EvalForgeNode currentNode, EvalNodeUtilFactoryFilter filter) { foreach (var node in currentNode.ChildNodes) { if (filter.Consider(node)) { set.Add(node); } RecursiveGetChildNodes(set, node, filter); } }