共用方式為


IVsLibrary2.GetBrowseContainersForHierarchy Method

Returns an array of Browse Containers that correspond to the given IVsHierarchy.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)

Syntax

'宣告
Function GetBrowseContainersForHierarchy ( _
    pHierarchy As IVsHierarchy, _
    celt As UInteger, _
    <OutAttribute> rgBrowseContainers As VSBROWSECONTAINER(), _
    <OutAttribute> pcActual As UInteger() _
) As Integer
'用途
Dim instance As IVsLibrary2
Dim pHierarchy As IVsHierarchy
Dim celt As UInteger
Dim rgBrowseContainers As VSBROWSECONTAINER()
Dim pcActual As UInteger()
Dim returnValue As Integer

returnValue = instance.GetBrowseContainersForHierarchy(pHierarchy, _
    celt, rgBrowseContainers, pcActual)
int GetBrowseContainersForHierarchy(
    IVsHierarchy pHierarchy,
    uint celt,
    VSBROWSECONTAINER[] rgBrowseContainers,
    uint[] pcActual
)
int GetBrowseContainersForHierarchy(
    [InAttribute] IVsHierarchy^ pHierarchy, 
    [InAttribute] unsigned int celt, 
    [OutAttribute] array<VSBROWSECONTAINER>^ rgBrowseContainers, 
    [OutAttribute] array<unsigned int>^ pcActual
)
abstract GetBrowseContainersForHierarchy : 
        pHierarchy:IVsHierarchy * 
        celt:uint32 * 
        rgBrowseContainers:VSBROWSECONTAINER[] byref * 
        pcActual:uint32[] byref -> int 
function GetBrowseContainersForHierarchy(
    pHierarchy : IVsHierarchy, 
    celt : uint, 
    rgBrowseContainers : VSBROWSECONTAINER[], 
    pcActual : uint[]
) : int

Parameters

  • celt
    Type: System.UInt32
    [in] The number of elements in the rgBrowseContainers array.
  • pcActual
    Type: array<System.UInt32[]
    [out] The actual number of containers returned in rgBrowseContainers.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell80.idl:

HRESULT IVsLibrary2::GetBrowseContainersForHierarchy(
   [in] IVsHierarchy *pHierarchy, 
   [in] ULONG celt, 
   [in, out, size_is(celt)] VSBROWSECONTAINER rgBrowseContainers[], 
   [out, optional] ULONG *pcActual
);

The environment calls this method twice to obtain a list of browse containers corresponding to a given project hierarchy. In the first call, the environment sets celt and rgBrowseContainers to nulla null reference (Nothing in Visual Basic). This method returns in the pcActual parameter the number of browse containers in the hierarchy pointed to be pHierarchy. The environment then allocates the rgBrowseContainers array and calls GetBrowseContainersForHierarchy again. With this call, the method fills the rgBrowseContainers array with VSBROWSECONTAINER structures identifying the browse containers within your hierarchy. Return a count in celt only if your package owns the requested hierarchy.

This method is meaningful only for libraries providing project browse containers.

.NET Framework Security

See Also

Reference

IVsLibrary2 Interface

IVsLibrary2 Members

Microsoft.VisualStudio.Shell.Interop Namespace