Visual Studio Automation and Extensibility Reference
DTEEventsClass.OnMacrosRuntimeReset Event

This event supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Occurs when the common language runtime resets, clearing all global variable data and losing all event connections.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

Syntax

Visual Basic (Declaration)
Public Event OnMacrosRuntimeReset As _dispDTEEvents_OnMacrosRuntimeResetEventHandler Implements _dispDTEEvents_Event.OnMacrosRuntimeReset
Visual Basic (Usage)
Dim instance As DTEEventsClass
Dim handler As _dispDTEEvents_OnMacrosRuntimeResetEventHandler

AddHandler instance.OnMacrosRuntimeReset, handler
C#
public virtual event _dispDTEEvents_OnMacrosRuntimeResetEventHandler _dispDTEEvents_Event.OnMacrosRuntimeReset
C++
public:
virtual event _dispDTEEvents_OnMacrosRuntimeResetEventHandler^ OnMacrosRuntimeReset {
    void add (_dispDTEEvents_OnMacrosRuntimeResetEventHandler^ A_1) = _dispDTEEvents_Event::OnMacrosRuntimeReset::add;
    void remove (_dispDTEEvents_OnMacrosRuntimeResetEventHandler^ A_1) = _dispDTEEvents_Event::OnMacrosRuntimeReset::remove;
}
J#
J# supports the use of explicit interface implementations, but not the declaration of new ones.
JScript
JScript supports the use of events, but not the declaration of new ones.
Remarks

If you connect event handlers not in the EnvironmentEvents host item or initialize global variables, you must re-execute that code in the OnMacrosRuntimeReset event handler, because resetting the macros runtime destroys global variable values and event connections.

Example

Visual Basic
Public Sub DTEEvents_OnMacrosRuntimeReset() Handles DTEEvents.OnMacrosRuntimeReset
    MsgBox("The CLR is being reset.")
End Sub
See Also

Tags :


Page view tracker