Esempio n. 1
0
 private void RemoveTaggedNodes(IBuildTreeNode tree, List <IBuildTreeNode> taggedNodes)
 {
     foreach (var node in tree.Children.ToList())
     {
         if (taggedNodes.Contains(node))
         {
             tree.RemoveChild(node);
         }
         else
         {
             RemoveTaggedNodes(node, taggedNodes);
         }
     }
 }
 private void RemoveTaggedNodes(IBuildTreeNode tree, List <IBuildTreeNode> taggedNodes)
 {
     foreach (var node in tree.Children.ToList())
     {
         if (taggedNodes.Any(x => ReferenceEquals(x, node)))
         {
             tree.RemoveChild(node);
         }
         else
         {
             RemoveTaggedNodes(node, taggedNodes);
         }
     }
 }
        private void CutTree(IBuildTreeNode tree)
        {
            var buildChildrenToRemove = tree.Children.OfType <IBuildNode>()
                                        .OrderByDescending(x => x.Build.LastChangedTime ?? DateTime.MinValue)
                                        .Skip(_configuration.BuildsToShow)
                                        .ToList();

            foreach (var node in buildChildrenToRemove)
            {
                tree.RemoveChild(node);
            }

            foreach (var child in tree.Children)
            {
                CutTree(child);
            }
        }