Sdílet prostřednictvím


Breakpoint2.Enabled – vlastnost

Nastaví nebo vrátí povoleného stavu zarážka.

Obor názvů:  EnvDTE80
Sestavení:  EnvDTE80 (v EnvDTE80.dll)

Syntaxe

'Deklarace
Property Enabled As Boolean
bool Enabled { get; set; }
property bool Enabled {
    bool get ();
    void set (bool value);
}
abstract Enabled : bool with get, set
function get Enabled () : boolean 
function set Enabled (value : boolean)

Hodnota vlastnosti

Typ: Boolean
Logická hodnota, která je true Pokud zarážka povolena, jinak false.

Příklady

Následující příklad demonstruje použití Enabled vlastnost.

Tato vlastnost testování:

  1. Nastavte zarážky v cílové aplikaci.

  2. Spusťte doplněk.

    Je povolen stav zarážky.

  3. Zarážka zakážete pomocí pravým tlačítkem myši.

  4. Spusťte doplněk.

    Zarážky státu je zakázána.

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();

    // dte is a reference to the DTE2 object passed to you by the
    // OnConnection method that you implement when you create an Add-in.
    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

Zabezpečení rozhraní .NET Framework

Viz také

Referenční dokumentace

Breakpoint2 Rozhraní

EnvDTE80 – obor názvů

Další zdroje

Postupy: Kompilace a spuštění příkladů kódu objektu automatizace