Share via


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
public virtual event _dispDebuggerEvents_OnEnterDesignModeEventHandler OnEnterDesignMode
public:
virtual   event _dispDebuggerEvents_OnEnterDesignModeEventHandler^ OnEnterDesignMode {
    void add (_dispDebuggerEvents_OnEnterDesignModeEventHandler^ value);
    void remove (_dispDebuggerEvents_OnEnterDesignModeEventHandler^ value);
}
abstract OnEnterDesignMode : IEvent<_dispDebuggerEvents_OnEnterDesignModeEventHandler,
    EventArgs>
override OnEnterDesignMode : IEvent<_dispDebuggerEvents_OnEnterDesignModeEventHandler,
    EventArgs>
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:

  1. Open the target application.

  2. Run the add-in.

    Observe the message box: "Events are attached."

  3. Set a breakpoint and run the target application in the debug mode.

  4. When the application stops at the breakpoint, stop the debugger.

    Observe the message box: "Debugger enters design mode."

  5. Run the target application that contains an infinite loop in the debug mode. Do not set a breakpoint.

  6. 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

See Also

Reference

DebuggerEventsClass Class

EnvDTE Namespace