Partager via


Breakpoint2.ConditionType, propriété

Obtient le type de condition du point d'arrêt qui peut être "arrêt si la valeur est True" ou "arrêt en cas de modification".

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

Syntaxe

'Déclaration
ReadOnly Property ConditionType As dbgBreakpointConditionType
    Get
dbgBreakpointConditionType ConditionType { get; }
property dbgBreakpointConditionType ConditionType {
    dbgBreakpointConditionType get ();
}
abstract ConditionType : dbgBreakpointConditionType
function get ConditionType () : dbgBreakpointConditionType

Valeur de propriété

Type : EnvDTE.dbgBreakpointConditionType
Une des valeurs dbgBreakpointConditionType.

Implémentations

Breakpoint.ConditionType

Notes

Ce type peut indiquer d'arrêter si la valeur est True ou en cas de modification.

Exemples

L'exemple suivant montre comment utiliser la propriété ConditionType.

Pour tester cette propriété :

  1. Exécutez le complément.

  2. Exécutez l'application cible.

public static void ConditionType(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("Breakpoint Condition and Type are: ");
    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;
    //Stop at the breakpoint, if TempC < TempF is true
    debugger.Breakpoints.Add("", "Target001.cs", 15, 1, "tempC < tempF",
                             EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue,
                             "C#", "", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone);
    string strCondition = debugger.Breakpoints.Item(1).Condition;
    string strConditionType = debugger.Breakpoints.Item(1).ConditionType.ToString();
    owp.OutputString(strCondition + "\n" + strConditionType);
}

Sécurité .NET Framework

Voir aussi

Référence

Breakpoint2 Interface

ConditionType, surcharge

EnvDTE80, espace de noms

Autres ressources

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

Comment : spécifier une condition de point d'arrêt