IVsTrackSelectionEx.OnElementValueChange Method
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.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
'宣言
Function OnElementValueChange ( _
elementid As UInteger, _
fDontPropagate As Integer, _
varValue As Object _
) As Integer
'使用
Dim instance As IVsTrackSelectionEx
Dim elementid As UInteger
Dim fDontPropagate As Integer
Dim varValue As Object
Dim returnValue As Integer
returnValue = instance.OnElementValueChange(elementid, _
fDontPropagate, varValue)
int OnElementValueChange(
uint elementid,
int fDontPropagate,
Object varValue
)
int OnElementValueChange(
[InAttribute] unsigned int elementid,
[InAttribute] int fDontPropagate,
[InAttribute] Object^ varValue
)
abstract OnElementValueChange :
elementid:uint32 *
fDontPropagate:int *
varValue:Object -> int
function OnElementValueChange(
elementid : uint,
fDontPropagate : int,
varValue : Object
) : int
Parameters
- elementid
Type: System.UInt32
[in] Identifier of the element that has changed. For a list of valid elementid values, see VSConstants.VSSELELEMID.
- fDontPropagate
Type: System.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
Type: System.Object
[in] Private data related to the element identified by elementid.
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 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.
.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.