Partager via


IVsSelectionEvents.OnSelectionChanged Method

Reports that the project hierarchy, item and/or selection container has changed.

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

Syntax

'Declaration
Function OnSelectionChanged ( _
    pHierOld As IVsHierarchy, _
    itemidOld As UInteger, _
    pMISOld As IVsMultiItemSelect, _
    pSCOld As ISelectionContainer, _
    pHierNew As IVsHierarchy, _
    itemidNew As UInteger, _
    pMISNew As IVsMultiItemSelect, _
    pSCNew As ISelectionContainer _
) As Integer
int OnSelectionChanged(
    IVsHierarchy pHierOld,
    uint itemidOld,
    IVsMultiItemSelect pMISOld,
    ISelectionContainer pSCOld,
    IVsHierarchy pHierNew,
    uint itemidNew,
    IVsMultiItemSelect pMISNew,
    ISelectionContainer pSCNew
)
int OnSelectionChanged(
    [InAttribute] IVsHierarchy^ pHierOld, 
    [InAttribute] unsigned int itemidOld, 
    [InAttribute] IVsMultiItemSelect^ pMISOld, 
    [InAttribute] ISelectionContainer^ pSCOld, 
    [InAttribute] IVsHierarchy^ pHierNew, 
    [InAttribute] unsigned int itemidNew, 
    [InAttribute] IVsMultiItemSelect^ pMISNew, 
    [InAttribute] ISelectionContainer^ pSCNew
)
abstract OnSelectionChanged : 
        pHierOld:IVsHierarchy * 
        itemidOld:uint32 * 
        pMISOld:IVsMultiItemSelect * 
        pSCOld:ISelectionContainer * 
        pHierNew:IVsHierarchy * 
        itemidNew:uint32 * 
        pMISNew:IVsMultiItemSelect * 
        pSCNew:ISelectionContainer -> int
function OnSelectionChanged(
    pHierOld : IVsHierarchy, 
    itemidOld : uint, 
    pMISOld : IVsMultiItemSelect, 
    pSCOld : ISelectionContainer, 
    pHierNew : IVsHierarchy, 
    itemidNew : uint, 
    pMISNew : IVsMultiItemSelect, 
    pSCNew : ISelectionContainer
) : int

Parameters

  • itemidOld
    Type: UInt32

    [in] Identifier of the project item for previous selection. For valid itemidOld values, see VSITEMID.

  • itemidNew
    Type: UInt32

    [in] Identifier of the project item for the current selection. For valid itemidNew values, see VSITEMID.

Return Value

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsSelectionEvents::OnSelectionChanged(
   [in] IVsHierarchy *pHierOld,
   [in] VSITEMID itemidOld,
   [in] IVsMultiItemSelect *pMISOld,
   [in] ISelectionContainer *pSCOld,
   [in] IVsHierarchy *pHierNew,
   [in] VSITEMID itemidNew,
   [in] IVsMultiItemSelect *pMISNew,
   [in] ISelectionContainer *pSCNew
);

.NET Framework Security

See Also

Reference

IVsSelectionEvents Interface

Microsoft.VisualStudio.Shell.Interop Namespace