Compartir a través de


Breakpoint2.Enabled Property

Definition

Sets or returns the enabled state of the breakpoint.

public:
 property bool Enabled { bool get(); void set(bool value); };
public:
 property bool Enabled { bool get(); void set(bool value); };
[System.Runtime.InteropServices.DispId(113)]
public bool Enabled { [System.Runtime.InteropServices.DispId(113)] get; [System.Runtime.InteropServices.DispId(113)] set; }
[<System.Runtime.InteropServices.DispId(113)>]
[<get: System.Runtime.InteropServices.DispId(113)>]
[<set: System.Runtime.InteropServices.DispId(113)>]
member this.Enabled : bool with get, set
Public Property Enabled As Boolean

Property Value

A boolean value that is true if the breakpoint is enabled, otherwise false.

Implements

Attributes

Examples

The following example demonstrates how to use the Enabled property.

public static void Enabled(EnvDTE80.DTE2 dte)  
{  
    // Setup 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("Enabled property: ");  
    owp.Activate();  

    EnvDTE80.Debugger2 debugger = (EnvDTE80.Debugger2)dte.Debugger;  
    owp.OutputString("Breakpoint in the file " + debugger.Breakpoints.Item(1).File);  
    owp.OutputString(" on line " +  
                     debugger.Breakpoints.Item(1).FileLine.ToString() + " column ");  
    owp.OutputString(debugger.Breakpoints.Item(1).FileColumn.ToString() + " is ");  
    owp.OutputString(debugger.Breakpoints.Item(1).Enabled ? "enabled." : "disabled.");  
    owp.OutputString("\nThis breakpoint is in the function: " +  
                     debugger.Breakpoints.Item(1).FunctionName);  
}  
Sub EnabledSamplesVB(ByVal dte As DTE2)  

    If MsgBox("Disable all breakpoints?", MsgBoxStyle.YesNo) _  
        = MsgBoxResult.Yes Then  
        Dim bp As Breakpoint  
        For Each bp In dte.Debugger.Breakpoints  
            bp.Enabled = False  
        Next  
    End If  

End Sub  

Applies to