IVsMultiItemSelect.GetSelectedItems Method
Returns an IVsHierarchy interface pointer and item identifier for selected items.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
‘선언
Function GetSelectedItems ( _
grfGSI As UInteger, _
cItems As UInteger, _
<OutAttribute> rgItemSel As VSITEMSELECTION() _
) As Integer
‘사용 방법
Dim instance As IVsMultiItemSelect
Dim grfGSI As UInteger
Dim cItems As UInteger
Dim rgItemSel As VSITEMSELECTION()
Dim returnValue As Integer
returnValue = instance.GetSelectedItems(grfGSI, _
cItems, rgItemSel)
int GetSelectedItems(
uint grfGSI,
uint cItems,
VSITEMSELECTION[] rgItemSel
)
int GetSelectedItems(
[InAttribute] unsigned int grfGSI,
[InAttribute] unsigned int cItems,
[OutAttribute] array<VSITEMSELECTION>^ rgItemSel
)
abstract GetSelectedItems :
grfGSI:uint32 *
cItems:uint32 *
rgItemSel:VSITEMSELECTION[] byref -> int
function GetSelectedItems(
grfGSI : uint,
cItems : uint,
rgItemSel : VSITEMSELECTION[]
) : int
Parameters
- grfGSI
Type: System.UInt32
[in] Flag providing information about how the selected items should be returned. For valid grfGSI values, see __VSGSIFLAGS.
- cItems
Type: System.UInt32
[in] Number of items that are selected.
- rgItemSel
Type: array<Microsoft.VisualStudio.Shell.Interop.VSITEMSELECTION[]
[out, size_is(cItems)] Array of VSITEMSELECTION structures which contain an IVsHierarchy pointer and item identifier for each selected item.
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 vsshell.idl:
HRESULT IVsMultiItemSelect::GetSelectedItems(
[in] VSGSIFLAGS grfGSI,
[in] ULONG cItems,
[out, size_is(cItems)] VSITEMSELECTION rgItemSel[]
);
If all selected items belong to a single hierarchy, set the pHier member of each VSITEMSELECTION structure to point to the IVsHierarchy interface for that hierarchy. Set the itemid member of each structure to VSITEMID_SELECTION.
If the selected items belong to multiple hierarchies, set the pHier member of each VSITEMSELECTION structure to point to the first common IVsHierarchy interface, typically the parent hierarchy. Set the itemid member of each structure to VSITEMID_SELECTION.
The information retrieved from GetSelectedItems can be used to update the Solution Explorer.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.