다음을 통해 공유


VsShellUtilities.GetProject(IServiceProvider, String) Method

Definition

Returns a project for the specified document.

public:
 static Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ GetProject(IServiceProvider ^ site, System::String ^ moniker);
public static Microsoft.VisualStudio.Shell.Interop.IVsHierarchy GetProject (IServiceProvider site, string moniker);
static member GetProject : IServiceProvider * string -> Microsoft.VisualStudio.Shell.Interop.IVsHierarchy
Public Shared Function GetProject (site As IServiceProvider, moniker As String) As IVsHierarchy
Public Function GetProject (site As IServiceProvider, moniker As String) As IVsHierarchy

Parameters

site
IServiceProvider

The service provider.

moniker
String

The document moniker.

Returns

If the document is open, this is a reference to the IVsUIHierarchy Interface implementation of the project that owns the document. If the document is not open, the value of this parameter is NULL.

Remarks

If the document is a file, moniker can be the file extension rather than the full path to the file (for example, .bmp or .txt). If the document is not a file, moniker is often a URL.

Applies to