Breakpoint2.Enabled 屬性
設定或傳回這個中斷點的啟用狀態。
命名空間: EnvDTE80
組件: EnvDTE80 (在 EnvDTE80.dll 中)
語法
'宣告
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)
屬性值
類型:Boolean
布林值,如果中斷點己啟用,則為 true,否則為 false。
範例
下列範例示範如何使用 Enabled 屬性。
若要測試這個屬性:
請在目標應用程式中設定中斷點。
執行增益集。
中斷點狀態為啟用狀態。
按一下滑鼠右鍵停用中斷點。
執行增益集。
中斷點狀態為停用狀態。
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
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。