Breakpoint2.HitCountTarget 属性

定义

获取针对任意类型断点的命中次数。 根据命中次数类型的不同,它有不同的解释。

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

属性值

Int32

一个包含任何断点类型的命中次数目标的整数。

实现

属性

示例

下面的示例演示如何使用 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

适用于