Partager via


Breakpoint2.HitCountTarget, propriété

Obtient le nombre d'accès pour tout type de point d'arrêt. Il est interprété selon le type de nombre d'accès.

Espace de noms :  EnvDTE80
Assembly :  EnvDTE80 (dans EnvDTE80.dll)

Syntaxe

'Déclaration
ReadOnly Property HitCountTarget As Integer
int HitCountTarget { get; }
property int HitCountTarget {
    int get ();
}
abstract HitCountTarget : int with get
function get HitCountTarget () : int

Valeur de propriété

Type : Int32
Entier qui contient le nombre d'accès pour tout type de point d'arrêt.

Notes

Un nombre d'accès est une propriété facultative qui détermine si votre programme s'interrompt lorsque le point d'arrêt est atteint. La propriété HitCountTarget est interprétée selon la propriété HitCountType. Pour plus d'informations, consultez dbgHitCountType.

Exemples

L'exemple suivant illustre l'utilisation de la propriété HitCountTarget.

Pour tester cette propriété :

  1. Définissez un point d'arrêt dans l'application cible.

  2. Définissez plusieurs propriétés de point d'arrêt dans la boîte de dialogue Propriétés/Nombre d'accès.

  3. Exécutez le complément.

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();

    // 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("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); 
}

Sécurité .NET Framework

Voir aussi

Référence

Breakpoint2 Interface

EnvDTE80, espace de noms

Autres ressources

Comment : compiler et exécuter les exemples de code du modèle objet Automation