Compartir a través de


IVsHierarchyItemManager.TryGetHierarchyItem Method

Gets a cached IVsHierarchyItem representing the specified hierarchy and item identifier, if one has already been created.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.Immutable.11.0 (in Microsoft.VisualStudio.Shell.Immutable.11.0.dll)

Syntax

'Declaration
Function TryGetHierarchyItem ( _
    hierarchy As IVsHierarchy, _
    itemid As UInteger, _
    <OutAttribute> ByRef item As IVsHierarchyItem _
) As Boolean
bool TryGetHierarchyItem(
    IVsHierarchy hierarchy,
    uint itemid,
    out IVsHierarchyItem item
)
bool TryGetHierarchyItem(
    IVsHierarchy^ hierarchy, 
    unsigned int itemid, 
    [OutAttribute] IVsHierarchyItem^% item
)
abstract TryGetHierarchyItem : 
        hierarchy:IVsHierarchy * 
        itemid:uint32 * 
        item:IVsHierarchyItem byref -> bool
function TryGetHierarchyItem(
    hierarchy : IVsHierarchy, 
    itemid : uint, 
    item : IVsHierarchyItem
) : boolean

Parameters

  • itemid
    Type: UInt32

    The item identifier.

Return Value

Type: Boolean
true if the IVsHierarchyItem exists and was returned, otherwise false.

Remarks

The returned IVsHierarchyItem can be used to get properties about the item and to visit its parent and child items.

.NET Framework Security

See Also

Reference

IVsHierarchyItemManager Interface

Microsoft.VisualStudio.Shell Namespace