共用方式為


IVsSimpleObjectList2.CountSourceItems Method

Returns the hierarchy and the number of ItemIDs corresponding to source files for the given list item.

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

Syntax

'宣告
Function CountSourceItems ( _
    index As UInteger, _
    <OutAttribute> ByRef ppHier As IVsHierarchy, _
    <OutAttribute> ByRef pItemid As UInteger, _
    <OutAttribute> ByRef pcItems As UInteger _
) As Integer
'用途
Dim instance As IVsSimpleObjectList2
Dim index As UInteger
Dim ppHier As IVsHierarchy
Dim pItemid As UInteger
Dim pcItems As UInteger
Dim returnValue As Integer

returnValue = instance.CountSourceItems(index, _
    ppHier, pItemid, pcItems)
int CountSourceItems(
    uint index,
    out IVsHierarchy ppHier,
    out uint pItemid,
    out uint pcItems
)
int CountSourceItems(
    [InAttribute] unsigned int index, 
    [OutAttribute] IVsHierarchy^% ppHier, 
    [OutAttribute] unsigned int% pItemid, 
    [OutAttribute] unsigned int% pcItems
)
abstract CountSourceItems : 
        index:uint32 * 
        ppHier:IVsHierarchy byref * 
        pItemid:uint32 byref * 
        pcItems:uint32 byref -> int 
function CountSourceItems(
    index : uint, 
    ppHier : IVsHierarchy, 
    pItemid : uint, 
    pcItems : uint
) : int

Parameters

  • index
    Type: System.UInt32
    [in] Specifies the index of the list item of interest.
  • pItemid
    Type: System.UInt32%
    [out] Specifies the itemid of an item within the hierarchy. Values are described in VSITEMID.
  • pcItems
    Type: System.UInt32%
    [out] Pointer to the count of items.

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 IVsSimpleObjectList2::CountSourceItems(
   [in]          ULONG           Index, 
   [out]         IVsHierarchy **ppHier, 
   [out]         VSITEMID      *pitemid, 
   [out, retval] ULONG         *pcItems
);

Return the count of items (these must be from a single hierarchy) that make up the source files for the list element at index. Also return a pointer to the hierarchy in ppHier and pitemid if requested. If there is more than 1 item, return VSITEMID_SELECTION and a subsequent call is made on GetMultipleSourceItems to get them. If there are no available source items, return VSITEMID_ROOT to indicate the root of the hierarchy as a whole.

This method applies to class view only, and must be implemented. This enables class view to act as an alternate hierarchy so that all your project level commands continue to work.

.NET Framework Security

See Also

Reference

IVsSimpleObjectList2 Interface

IVsSimpleObjectList2 Members

Microsoft.VisualStudio.Shell.Interop Namespace