test/Misc/EFTools/TestInfrastructure/VS/DteExtensions.cs
/// <summary>
///     Add an existing item to the given project. If the given project is null, it will add the item at the solution level.
/// </summary>
/// <param name="dte">DTE instance</param>
/// <param name="itemFilename">the filename for the new item, including extension</param>
/// <param name="containingProject">the project where the new item will be added</param>
Add an existing item to the given project. If the given project is null, it will add the item at the solution level.
Add an existing item to the given project . If the given project is null it will add the item at the solution level .
public static ProjectItem AddExistingItem(this DTE dte, string itemFilename, Project containingProject)
        {
            Debug.Assert(dte != null, "dte != null");
            Debug.Assert(!string.IsNullOrWhiteSpace(itemFilename), "!string.IsNullOrWhiteSpace(itemFilename)");
            Debug.Assert(containingProject != null, "containingProject != null");
            SelectProject(dte, containingProject);
            var projectItem = dte.ItemOperations.AddExistingItem(itemFilename);
            return projectItem;
        }
public static ProjectItem AddExistingItem ( this DTE dte , string itemFilename , Project containingProject ) { Debug . Assert ( dte != null , " " ) ; Debug . Assert ( ! string . IsNullOrWhiteSpace ( itemFilename ) , " " ) ; Debug . Assert ( containingProject != null , " " ) ; SelectProject ( dte , containingProject ) ; var projectItem = dte . ItemOperations . AddExistingItem ( itemFilename ) ; return projectItem ; }
Add an existing item to the given project.
Add an existing item to the given project .
// Select the containing project // Add the item
DTE
this
itemFilename
string
the filename for the new item, including extension
the filename for the new item including extension
containingProject
Project
the project where the new item will be added
the project where the new item will be added
dte
None