Export (0) Print
Expand All

Breakpoint.HitCountTarget Property

Gets the hit count target for any type of breakpoint. Interpreted based on the hit count type.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

int HitCountTarget { get; }

Property Value

Type: System.Int32
An integer value representing the hit count target for any type of breakpoint.

A hit count is an optional property that determines whether your program breaks when the breakpoint is reached.

The HitCountTarget property is interpreted based on the HitCountType. See dbgHitCountType and <PAVEOVER> How to: Specify a Hit Count for more information.

The following example demonstrates how to use the HitCountTarget property.

To test this property:

  1. Set a breakpoint in the target application.

  2. Set various breakpoint properties in Properties/Hit Count Dialog Box.

  3. Run the add-in.

public static void HitCountTarget(DTE 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 Test: ");

    // dte is a reference to the DTE object passed to you by the
    // OnConnection method that you implement when you create an add-in.
    EnvDTE.Debugger debugger = (EnvDTE.Debugger)dte.Debugger;
    owp.OutputString("HitCountTarget: " + 
    owp.OutputString("\nHitCountType: " + 
    owp.OutputString("\nLocationType: " + 
    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); 

© 2014 Microsoft