This documentation is archived and is not being maintained.

Breakpoint.Enabled Property

Sets or gets the enabled state of this Breakpoint object.

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

bool Enabled { get; set; }
/** @property */
boolean get_Enabled ()

/** @property */
void set_Enabled (/** @attribute InAttribute() */ boolean Enabled)

function get Enabled () : boolean

function set Enabled (Enabled : boolean)

Property Value

A Boolean value representing whether this T:EnvDTE.Breakpoint object is enabled or not.

Returns true if the breakpoint is enabled, false if not.

The following example demonstrates how to use the Enabled property.

To test this property:

  1. Set a breakpoint in the target application.

  2. Run the add-in. The breakpoint state is enabled.

  3. Disable the breakpoint using Right Mouse Click.

  4. Run the add-in. The breakpoint state is disabled.

public static void Enabled(DTE 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 Test: ");

    // dte is a reference to the DTE object passed to you by the
    // OnConnection method that you implement when you create an add-in.
    EnvDTE.Debugger debugger = (EnvDTE.Debugger)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: " +