Пример #1
0
 /// <summary>
 /// Does a depth first search and returns the first node that satisfies the SearchCondition.
 /// </summary>
 /// <param name="node"></param>
 /// <param name="condition"></param>
 /// <returns></returns>
 public static ProjectFileTreeNode DepthFirstSearch(ProjectFileTreeNode node, ProjectFileSearchCondition condition)
 {
     if (condition.Satisfied(node))
     {
         return(node);
     }
     foreach (ProjectFileTreeNode childNode in node.ChildNodes)
     {
         ProjectFileTreeNode result = DepthFirstSearch(childNode, condition);
         if (result != null)
         {
             return(result);
         }
     }
     return(null);
 }
Пример #2
0
 public ProjectFileTreeNode DepthFirstSearch(ProjectFileSearchCondition condition)
 {
     return DepthFirstSearch(this, condition);
 }
Пример #3
0
 /// <summary>
 /// Does a depth first search and returns the first node that satisfies the SearchCondition.
 /// </summary>
 /// <param name="node"></param>
 /// <param name="condition"></param>
 /// <returns></returns>
 public static ProjectFileTreeNode DepthFirstSearch(ProjectFileTreeNode node, ProjectFileSearchCondition condition)
 {
     if (condition.Satisfied(node))
         return node;
     foreach (ProjectFileTreeNode childNode in node.ChildNodes)
     {
         ProjectFileTreeNode result = DepthFirstSearch(childNode, condition);
         if (result != null)
             return result;
     }
     return null;
 }
Пример #4
0
 public ProjectFileTreeNode DepthFirstSearch(ProjectFileSearchCondition condition)
 {
     return(DepthFirstSearch(this, condition));
 }