다음을 통해 공유


Debugger.CurrentMode Property

Definition

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

public:
 property EnvDTE::dbgDebugMode CurrentMode { EnvDTE::dbgDebugMode get(); };
public:
 property EnvDTE::dbgDebugMode CurrentMode { EnvDTE::dbgDebugMode get(); };
[System.Runtime.InteropServices.DispId(102)]
public EnvDTE.dbgDebugMode CurrentMode { [System.Runtime.InteropServices.DispId(102)] get; }
[<System.Runtime.InteropServices.DispId(102)>]
[<get: System.Runtime.InteropServices.DispId(102)>]
member this.CurrentMode : EnvDTE.dbgDebugMode
Public ReadOnly Property CurrentMode As dbgDebugMode

Property Value

A dbgDebugMode value.

Attributes

Examples

The following example demonstrates how to use the CurrentMode property.

public static void CurrentMode(DTE dte)  
{  
    // Setup the debug Output window.  
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);  
    w.Visible = true;  
    OutputWindow ow = (OutputWindow)w.Object;  
    OutputWindowPane owp = ow.OutputWindowPanes.Add("Current Mode Test");  
    owp.Activate();  

    owp.OutputString("Current Mode: ");  
    switch(dte.Debugger.CurrentMode)  
    {  
        case dbgDebugMode.dbgDesignMode:  
            owp.OutputString("Design Mode");  
            break;  
        case dbgDebugMode.dbgBreakMode:  
            owp.OutputString("Break Mode");  
            break;  
        case dbgDebugMode.dbgRunMode:  
            owp.OutputString("Run Mode");  
            break;  
    }  
}  
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  

Applies to