This documentation is archived and is not being maintained.

Debugger.CurrentMode Property

Gets the current mode of the debugger within the context of the integrated development environment (IDE).

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

ReadOnly Property CurrentMode As dbgDebugMode
Dim instance As Debugger
Dim value As dbgDebugMode

value = instance.CurrentMode

/** @property */
dbgDebugMode get_CurrentMode ()

function get CurrentMode () : dbgDebugMode

Property Value

A dbgDebugMode value.

The following example demonstrates how to use the CurrentMode property.

To test this property:

  1. Design Mode: open the target application and run the add-in.

  2. Break Mode: set a breakpoint in the target application and run it. When the application stops at the breakpoint, run the add-in.

  3. Run Mode: run the target application in the debug mode. Use an infinite loop in the application program. Run the add-in.

Shared Sub CurrentMode(ByRef dte As EnvDTE.DTE)
    Select Case dte.Debugger.CurrentMode
        Case dbgDebugMode.dbgDesignMode
            MessageBox.Show("Current Mode: Design", "Debugger Test")
        Case dbgDebugMode.dbgBreakMode
            MessageBox.Show("Current Mode: Break", "Debugger Test")
        Case dbgDebugMode.dbgRunMode
            MessageBox.Show("Current Mode: Run", "Debugger Test")
    End Select
End Sub