Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Returns a project for the specified document.
Namespace: Microsoft.VisualStudio.Shell
Assemblies: Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)
Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)
Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
Syntax
'Declaration
Public Shared Function GetProject ( _
site As IServiceProvider, _
moniker As String _
) As IVsHierarchy
'Usage
Dim site As IServiceProvider
Dim moniker As String
Dim returnValue As IVsHierarchy
returnValue = VsShellUtilities.GetProject(site, _
moniker)
public static IVsHierarchy GetProject(
IServiceProvider site,
string moniker
)
public:
static IVsHierarchy^ GetProject(
IServiceProvider^ site,
String^ moniker
)
static member GetProject :
site:IServiceProvider *
moniker:string -> IVsHierarchy
public static function GetProject(
site : IServiceProvider,
moniker : String
) : IVsHierarchy
Parameters
- site
Type: System.IServiceProvider
The IServiceProvider object that is used to retrieve the IVsSolution object.
- moniker
Type: System.String
The unique identifier of the document in the project system.
Return Value
Type: Microsoft.VisualStudio.Shell.Interop.IVsHierarchy
The IVsHierarchy interface of the project that contains the document.
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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.