src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/IProjectTreeExtensions.cs
/// <summary>
/// Removes given list of elements form IProjectTree
/// </summary>
/// <param name="tree"></param>
/// <param name="itemsToRemove"></param>
/// <param name="itemFilter"></param>
/// <returns></returns>
Removes given list of elements form IProjectTree
Removes given list of elements form IProjectTree
public static IProjectTree RemoveElementsFromTree(this IProjectTree tree,
            IEnumerable<string> itemsToRemove,
            Func<string, bool> itemFilter)
        {
            foreach (string file in itemsToRemove)
            {
                if (itemFilter(file))
                {
                    var existingNode = tree.FindNodeByPath(file);
                    System.Diagnostics.Debug.Assert(existingNode != null);
                    if (existingNode != null)
                    {
                        tree = existingNode.Remove();
                    }
                }
            }
            return tree;
        }
public static IProjectTree RemoveElementsFromTree ( this IProjectTree tree , IEnumerable < string > itemsToRemove , Func < string , bool > itemFilter ) { foreach ( string file in itemsToRemove ) { if ( itemFilter ( file ) ) { var existingNode = tree . FindNodeByPath ( file ) ; System . Diagnostics . Debug . Assert ( existingNode != null ) ; if ( existingNode != null ) { tree = existingNode . Remove ( ) ; } } } return tree ; }
Removes given list of elements form IProjectTree
Removes given list of elements form IProjectTree
// See if we already have this one -  we shouldn't
None
IProjectTree
this
itemsToRemove
IEnumerable<string>
None
itemFilter
Func<string, bool>
None
tree
None