Partager via


RunningDocumentTable.GetHierarchyItem Method

Gets the project that owns the specified document.

This API is not CLS-compliant. 

Namespace:  Microsoft.VisualStudio.Shell
Assemblies:   Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
  Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)
  Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)

Syntax

'Déclaration
<CLSCompliantAttribute(False)> _
Public Function GetHierarchyItem ( _
    moniker As String _
) As IVsHierarchy
'Utilisation
Dim instance As RunningDocumentTable
Dim moniker As String
Dim returnValue As IVsHierarchy

returnValue = instance.GetHierarchyItem(moniker)
[CLSCompliantAttribute(false)]
public IVsHierarchy GetHierarchyItem(
    string moniker
)
[CLSCompliantAttribute(false)]
public:
IVsHierarchy^ GetHierarchyItem(
    String^ moniker
)
[<CLSCompliantAttribute(false)>]
member GetHierarchyItem : 
        moniker:string -> IVsHierarchy 
public function GetHierarchyItem(
    moniker : String
) : IVsHierarchy

Parameters

Return Value

Type: Microsoft.VisualStudio.Shell.Interop.IVsHierarchy
IVsHierarchy, otherwise nulla null reference (Nothing in Visual Basic).

Remarks

If this method returns nulla null reference (Nothing in Visual Basic), then no project owns the specified document. Note that this method does not return the item ID of the document within the project, just the IVsHierarchy object that represents the project. To obtain the item ID of the document, call either the FindDocument(String, IVsHierarchy%, UInt32%, UInt32%) method or the ParseCanonicalName method.

.NET Framework Security

See Also

Reference

RunningDocumentTable Class

RunningDocumentTable Members

Microsoft.VisualStudio.Shell Namespace