Breakpoint2.HitCountTarget 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取针对任意类型断点的命中次数。 根据命中次数类型的不同,它有不同的解释。
public:
property int HitCountTarget { int get(); };
public:
property int HitCountTarget { int get(); };
[System.Runtime.InteropServices.DispId(112)]
public int HitCountTarget { [System.Runtime.InteropServices.DispId(112)] get; }
[<System.Runtime.InteropServices.DispId(112)>]
[<get: System.Runtime.InteropServices.DispId(112)>]
member this.HitCountTarget : int
Public ReadOnly Property HitCountTarget As Integer
属性值
一个包含任何断点类型的命中次数目标的整数。
实现
- 属性
示例
下面的示例演示如何使用 HitCountTarget 属性。
public static void HitCountTarget(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("HitCountTarget property: ");
owp.Activate();
EnvDTE80.Debugger2 debugger = (EnvDTE80.Debugger2)dte.Debugger;
owp.OutputString("HitCountTarget: " +
debugger.Breakpoints.Item(1).HitCountTarget);
owp.OutputString("\nHitCountType: " +
debugger.Breakpoints.Item(1).HitCountType);
owp.OutputString("\nLocationType: " +
debugger.Breakpoints.Item(1).LocationType);
owp.OutputString("\nName: " + debugger.Breakpoints.Item(1).Name);
debugger.Breakpoints.Item(1).Tag = "My Breakpoint";
owp.OutputString("\nTag: " + debugger.Breakpoints.Item(1).Tag);
owp.OutputString("\nType: " + debugger.Breakpoints.Item(1).Type);
}
注解
命中次数是一个可选属性,用于确定当到达断点时程序是否中断。 HitCountTarget属性根据属性进行解释 HitCountType 。 有关更多信息,请参见dbgHitCountType。