Partager via


IVsSelectionEvents Interface

Notifies registered VSPackages of changes to the current selection, element value, or command UI context.

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

Syntax

'Declaration
<GuidAttribute("82871589-D680-4D86-B969-9D1102B00F6F")> _
<InterfaceTypeAttribute()> _
Public Interface IVsSelectionEvents
[GuidAttribute("82871589-D680-4D86-B969-9D1102B00F6F")]
[InterfaceTypeAttribute()]
public interface IVsSelectionEvents
[GuidAttribute(L"82871589-D680-4D86-B969-9D1102B00F6F")]
[InterfaceTypeAttribute()]
public interface class IVsSelectionEvents
[<GuidAttribute("82871589-D680-4D86-B969-9D1102B00F6F")>]
[<InterfaceTypeAttribute()>]
type IVsSelectionEvents =  interface end
public interface IVsSelectionEvents

The IVsSelectionEvents type exposes the following members.

Methods

  Name Description
Public method OnCmdUIContextChanged Reports that the command UI context has changed.
Public method OnElementValueChanged Reports that an element value has changed.
Public method OnSelectionChanged Reports that the project hierarchy, item and/or selection container has changed.

Top

Remarks

To receive notifications, you must first register with the SVsShellMonitorSelection service by calling AdviseSelectionEvents. The pSink parameter to this method holds a pointer to your IVsSelectionEvents interface.

Each method in IVsSelectionEvents reports a different type of change. For example, when the current selection changes, your OnSelectionChanged method is called.

Notes to Implementers

VSPackages implement IVsSelectionEvents to be able to track selection changes in the environment.

See Also

Reference

Microsoft.VisualStudio.Shell.Interop Namespace