共用方式為


VsShellUtilities.GetHierarchy(IServiceProvider, Guid) Method

Definition

Gets the hierarchy node that is specified by the project GUID.

public:
 static Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ GetHierarchy(IServiceProvider ^ site, Guid projectGuid);
public static Microsoft.VisualStudio.Shell.Interop.IVsHierarchy GetHierarchy (IServiceProvider site, Guid projectGuid);
static member GetHierarchy : IServiceProvider * Guid -> Microsoft.VisualStudio.Shell.Interop.IVsHierarchy
Public Shared Function GetHierarchy (site As IServiceProvider, projectGuid As Guid) As IVsHierarchy
Public Function GetHierarchy (site As IServiceProvider, projectGuid As Guid) As IVsHierarchy

Parameters

site
IServiceProvider

The service provider.

projectGuid
Guid

A project guid.

Returns

A reference to an IVsHierarchy interface.

Remarks

If the project is not open, this method will catch and trace an InvalidCastException.

Applies to