다음을 통해 공유


IVsTrackSelectionEx.OnElementValueChange(UInt32, Int32, Object) Method

Definition

Informs the environment that a change in an element value has occurred. Element values are attached to a window's selection context and used in the same way to update the environment's user interface.

public:
 int OnElementValueChange(System::UInt32 elementid, int fDontPropagate, System::Object ^ varValue);
public:
 int OnElementValueChange(unsigned int elementid, int fDontPropagate, Platform::Object ^ varValue);
int OnElementValueChange(unsigned int elementid, int fDontPropagate, winrt::Windows::Foundation::IInspectable const & varValue);
public int OnElementValueChange (uint elementid, int fDontPropagate, object varValue);
abstract member OnElementValueChange : uint32 * int * obj -> int
Public Function OnElementValueChange (elementid As UInteger, fDontPropagate As Integer, varValue As Object) As Integer

Parameters

elementid
UInt32

[in] Identifier of the element that has changed. For a list of valid elementid values, see VSConstants.VSSELELEMID.

fDontPropagate
Int32

[in] Flag that indicates whether or not selected values should be broadcast throughout the environment. If set to true, the information stored in varValue relating to the element is kept private. If set to false, the varValue information is made available to the environment.

varValue
Object

[in] Private data related to the element identified by elementid.

Returns

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsTrackSelectionEx::OnElementValueChange(  
   [in] VSSELELEMID elementid,  
   [in] BOOL fDontPropagate,  
   [in] VARIANT varValue  
);  

An editor or tool calls OnElementValueChange when its containing frame becomes active.

The fDontPropagate parameter controls whether information pertaining to the element is published at the global level or kept private. By default, all elements of selection set fDontPropagate to true when a window is first created. Elements of selection that are managed at the global level by the environment or another VSPackage should remain with "DontPropagate" at the document/tool window level. For example, the SolutionBuildManager manages the SEID_StartupProject element and sets fDontPropagate for all of the windows owned by the project to true.

Elements of selection that are managed by the context of the document should set to fDontPropagate==false. For example, a document might want to publicize its UndoManager element (SEID_UndoManager) so that other windows such as the Properties window can add undo actions to the document's undo stack. Clients that have registered for selection events are notified only when fDontPropagate is set to false.

Applies to