Proprietà Breakpoint2.Enabled
Imposta o restituisce lo stato attivato il punto di interruzione.
Spazio dei nomi: EnvDTE80
Assembly: EnvDTE80 (in EnvDTE80.dll)
Sintassi
'Dichiarazione
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)
Valore proprietà
Tipo: System.Boolean
Un valore booleano che viene true se il punto di interruzione è attivato, altrimenti false.
Esempi
Nell'esempio seguente viene illustrato come utilizzare Enabled proprietà.
Per verificare questa proprietà:
Impostare un punto di interruzione nell'applicazione di destinazione.
eseguire il componente aggiuntivo.
Lo stato del punto di interruzione è attivato.
Disabilitare il punto di interruzione utilizzando un mouse fare clic con il pulsante destro del mouse.
eseguire il componente aggiuntivo.
Lo stato del punto di interruzione è disabilitato.
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
Sicurezza di .NET Framework
- Attendibilità totale per il chiamante immediato. Impossibile utilizzare questo membro in codice parzialmente attendibile. Per ulteriori informazioni, vedere Utilizzo di librerie da codice parzialmente attendibile.
Vedere anche
Riferimenti
Altre risorse
Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione