src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/IProjectTreeExtensions.cs
/// <summary>
/// Adds a givel list of elements to IProjectTree
/// </summary>
/// <param name="tree"></param>
/// <param name="itemsToAdd"></param>
/// <param name="itemFilter"></param>
/// <param name="nodeCreator"></param>
/// <returns></returns>
Adds a givel list of elements to IProjectTree
Adds a givel list of elements to IProjectTree
public static IProjectTree AddElementsToTree(this IProjectTree tree,
            IEnumerable<string> itemsToAdd,
            Func<string, bool> itemFilter,
            Func<string, IProjectTree> nodeCreator)
        {
            foreach (string item in itemsToAdd)
            {
                if (itemFilter(item))
                {
                    var existingNode = tree.FindNodeByPath(item);
                    System.Diagnostics.Debug.Assert(existingNode == null);
                    if (existingNode == null)
                    {
                        tree = tree.Add(nodeCreator(item)).Parent;
                    }
                }
            }
            return tree;
        }
public static IProjectTree AddElementsToTree ( this IProjectTree tree , IEnumerable < string > itemsToAdd , Func < string , bool > itemFilter , Func < string , IProjectTree > nodeCreator ) { foreach ( string item in itemsToAdd ) { if ( itemFilter ( item ) ) { var existingNode = tree . FindNodeByPath ( item ) ; System . Diagnostics . Debug . Assert ( existingNode == null ) ; if ( existingNode == null ) { tree = tree . Add ( nodeCreator ( item ) ) . Parent ; } } } return tree ; }
Adds a givel list of elements to IProjectTree
Adds a givel list of elements to IProjectTree
// Double check we don't already have this one -  we shouldn't
None
IProjectTree
this
itemsToAdd
IEnumerable<string>
None
itemFilter
Func<string, bool>
None
nodeCreator
Func<string, IProjectTree>
None
tree
None