Breakpoint2.Enabled 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
设置或返回断点的启用状态。
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
属性值
一个布尔值, 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();
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