Partager via


IVsObjectList2.CountSourceItems(UInt32, IVsHierarchy, UInt32, UInt32) Method

Definition

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

public:
 int CountSourceItems(System::UInt32 index, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ % ppHier, [Runtime::InteropServices::Out] System::UInt32 % pItemid, [Runtime::InteropServices::Out] System::UInt32 % pcItems);
int CountSourceItems(unsigned int index, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsHierarchy const & & ppHier, [Runtime::InteropServices::Out] unsigned int & pItemid, [Runtime::InteropServices::Out] unsigned int & pcItems);
public int CountSourceItems (uint index, out Microsoft.VisualStudio.Shell.Interop.IVsHierarchy ppHier, out uint pItemid, out uint pcItems);
abstract member CountSourceItems : uint32 * IVsHierarchy * uint32 * uint32 -> int
Public Function CountSourceItems (index As UInteger, ByRef ppHier As IVsHierarchy, ByRef pItemid As UInteger, ByRef pcItems As UInteger) As Integer

Parameters

index
UInt32

[in] Specifies the index of the list item of interest.

ppHier
IVsHierarchy

[out] Pointer to an IVsHierarchy interface.

pItemid
UInt32

[out] Specifies the itemid of an item within the hierarchy. Values are described in VSITEMID.

pcItems
UInt32

[out] Pointer to the count of items.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell80.idl:

[C++]

HRESULT IVsObjectList2::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.

Applies to