Exemple #1
0
 private static void RecursiveGetChildNodes(ICollection <EvalFactoryNode> set, EvalFactoryNode currentNode, EvalNodeUtilFactoryFilter filter)
 {
     foreach (var node in currentNode.ChildNodes)
     {
         if (filter.Consider(node))
         {
             set.Add(node);
         }
         RecursiveGetChildNodes(set, node, filter);
     }
 }
Exemple #2
0
        /// <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 <EvalFactoryNode> RecursiveGetChildNodes(EvalFactoryNode currentNode, EvalNodeUtilFactoryFilter filter)
        {
            ICollection <EvalFactoryNode> result = new LinkedHashSet <EvalFactoryNode>();

            if (filter.Consider(currentNode))
            {
                result.Add(currentNode);
            }
            RecursiveGetChildNodes(result, currentNode, filter);
            return(result);
        }