src/Misc/EFTools/DesignXmlCore/VisualStudio/VSHelpers.cs
/// <summary>
///     Get the itemId of the item specified by path, and the IVsHierarchy of the project containing the item using
///     a cached VsPackage (Package.GetGlobalService)
/// </summary>
/// <param name="originalPath">the full path to a document</param>
/// <param name="projectHierarchy">will contain the IVsHierarchy for the project</param>
/// <param name="itemId">will contain the itemID of the document</param>
/// <param name="isDocumentInProject">will be true if the document is contained in a project</param>
/// <param name="project">Out param will contain the Project that this item is contained in, or null if the item isn't in a project</param>
Get the itemId of the item specified by path, and the IVsHierarchy of the project containing the item using
a cached VsPackage (Package.GetGlobalService)
Get the itemId of the item specified by path and the IVsHierarchy of the project containing the item using a cached VsPackage ( Package . GetGlobalService )
private static void GetProjectAndFileInfoForPath(
            string originalPath, out IVsHierarchy projectHierarchy, out Project project, out uint fileItemId, out bool isDocumentInProject)
        {
            var solution = Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(SVsSolution)) as IVsSolution;
            GetProjectAndFileInfoForPath(
                originalPath, null, solution, out projectHierarchy, out project, out fileItemId, out isDocumentInProject);
        }
private static void GetProjectAndFileInfoForPath ( string originalPath , out IVsHierarchy projectHierarchy , out Project project , out uint fileItemId , out bool isDocumentInProject ) { var solution = Microsoft . VisualStudio . Shell . Package . GetGlobalService ( typeof ( SVsSolution ) ) as IVsSolution ; GetProjectAndFileInfoForPath ( originalPath , null , solution , out projectHierarchy , out project , out fileItemId , out isDocumentInProject ) ; }
Get the itemId of the item specified by path, and the IVsHierarchy of the project containing the item using
a cached VsPackage (Package.GetGlobalService)
Get the itemId of the item specified by path and the IVsHierarchy of the project containing the item using a cached VsPackage ( Package . GetGlobalService )
originalPath
string
the full path to a document
the full path to a document
IVsHierarchy
out
<not_specific>
Project
out
<not_specific>
uint
out
<not_specific>
bool
out
<not_specific>
projectHierarchy
<not_specific>
will contain the IVsHierarchy for the project
will contain the IVsHierarchy for the project
itemId
<not_specific>
will contain the itemID of the document
will contain the itemID of the document
isDocumentInProject
<not_specific>
will be true if the document is contained in a project
will be true if the document is contained in a project
project
<not_specific>
Out param will contain the Project that this item is contained in, or null if the item isn't in a project
Out param will contain the Project that this item is contained in or null if the item isn ' t in a project