src/Misc/EFTools/EntityDesignPackage/CustomCode/MicrosoftDataEntityDesignEditorFactory.cs
/// <summary>
///     When we "Add Existing Item", VS leaves it up to us to add the missing references in the project.
/// </summary>
/// <param name="projectItem">item whose references will be added to the owning project</param>
/// <param name="referenceFileNames">collection of names to add to project references</param>
When we "Add Existing Item", VS leaves it up to us to add the missing references in the project.
When we " Add Existing Item " VS leaves it up to us to add the missing references in the project .
internal static void AddMissingReferences(ProjectItem projectItem, ICollection<string> referenceFileNames)
        {
            if (referenceFileNames != null
                && referenceFileNames.Count != 0)
            {
                if (projectItem.ContainingProject != null
                    && projectItem.ContainingProject.Object != null)
                {
                    var vsProject = projectItem.ContainingProject.Object as VSProject2;
                    var vsWebSite = projectItem.ContainingProject.Object as VSWebSite;
                    if (vsProject != null)
                    {
                        AddMissingReferencesForProject(vsProject, referenceFileNames);
                    }
                    else if (vsWebSite != null)
                    {
                        AddMissingReferencesForWebsite(vsWebSite, referenceFileNames);
                    }
                    else
                    {
                        Debug.Fail("Could not resolve the project type to add references.");
                    }
                }
            }
        }
internal static void AddMissingReferences ( ProjectItem projectItem , ICollection < string > referenceFileNames ) { if ( referenceFileNames != null && referenceFileNames . Count != 0 ) { if ( projectItem . ContainingProject != null && projectItem . ContainingProject . Object != null ) { var vsProject = projectItem . ContainingProject . Object as VSProject2 ; var vsWebSite = projectItem . ContainingProject . Object as VSWebSite ; if ( vsProject != null ) { AddMissingReferencesForProject ( vsProject , referenceFileNames ) ; } else if ( vsWebSite != null ) { AddMissingReferencesForWebsite ( vsWebSite , referenceFileNames ) ; } else { Debug . Fail ( " " ) ; } } } }
When we "Add Existing Item", VS leaves it up to us to add the missing references in the project.
When we " Add Existing Item " VS leaves it up to us to add the missing references in the project .
projectItem
ProjectItem
item whose references will be added to the owning project
item whose references will be added to the owning project
referenceFileNames
ICollection<string>
collection of names to add to project references
collection of names to add to project references