DebuggerEventsClass.OnEnterDesignMode Event
This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Fired when leaving run mode or debug mode, and when the debugger establishes design mode after debugging.
Namespace: EnvDTE
Assembly: EnvDTE (in EnvDTE.dll)
Syntax
'Declaration
Public Overridable Event OnEnterDesignMode As _dispDebuggerEvents_OnEnterDesignModeEventHandler
'Usage
Dim instance As DebuggerEventsClass
Dim handler As _dispDebuggerEvents_OnEnterDesignModeEventHandler
AddHandler instance.OnEnterDesignMode, handler
public virtual event _dispDebuggerEvents_OnEnterDesignModeEventHandler OnEnterDesignMode
public:
virtual event _dispDebuggerEvents_OnEnterDesignModeEventHandler^ OnEnterDesignMode {
void add (_dispDebuggerEvents_OnEnterDesignModeEventHandler^ value);
void remove (_dispDebuggerEvents_OnEnterDesignModeEventHandler^ value);
}
JScript does not support events.
Implements
_dispDebuggerEvents_Event.OnEnterDesignMode
Remarks
Reflecting the overall state of the debugger, this event is fired when the debugger leaves run mode or debug mode. This event is fired whenever the debugger establishes design mode after debugging. See the CurrentMode property for more information.
Examples
The following example demonstrates how to use the OnEnterDesignMode event.
To test this event:
Open the target application.
Run the add-in.
Observe the message box: "Events are attached."
Set a breakpoint and run the target application in the debug mode.
When the application stops at the breakpoint, stop the debugger.
Observe the message box: "Debugger enters design mode."
Run the target application that contains an infinite loop in the debug mode. Do not set a breakpoint.
Stop the debugger.
Observe the message box: "Debugger enters design mode."
//Place the following code in the Exec method of the add-in:
EnvDTE.DebuggerEvents debugEvents = applicationObject.Events.DebuggerEvents;
debugEvents.OnEnterDesignMode +=
new _dispDebuggerEvents_OnEnterDesignModeEventHandler(DebuggerEvents.DesignHandler);
//Place the following Event handler code in the add-in:
// Needed to activate event handlers in Connect.Exec.
public static void StartEvents(DTE dte)
{
System.Windows.Forms.MessageBox.Show("Events are attached.");
}
// OnEnterDesignMode Event.
public static void DesignHandler(dbgEventReason reason)
{
System.Windows.Forms.MessageBox.Show("Debugger enters design mode.");
}
.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.