DebuggerStepThroughAttribute Classe

Définition

Indique au débogueur de parcourir le code au lieu d’effectuer un pas à pas dans le code. Cette classe ne peut pas être héritée.

public ref class DebuggerStepThroughAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)]
public sealed class DebuggerStepThroughAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)]
[System.Serializable]
public sealed class DebuggerStepThroughAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class DebuggerStepThroughAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)>]
type DebuggerStepThroughAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)>]
[<System.Serializable>]
type DebuggerStepThroughAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type DebuggerStepThroughAttribute = class
    inherit Attribute
Public NotInheritable Class DebuggerStepThroughAttribute
Inherits Attribute
Héritage
DebuggerStepThroughAttribute
Attributs

Remarques

Cet attribut est fourni pour être utilisé par les débogueurs de code source ; le Common Language Runtime n’est pas affecté par celui-ci. Par exemple, le débogueur Visual Studio ne s’arrête pas dans une méthode marquée avec cet attribut même si un point d’arrêt est défini dans la méthode.

L’attribut DebuggerStepThroughAttribute affecte la fonctionnalité Just My Code (JMC) de Visual Studio de la manière suivante :

  • Si JMC est activé, le débogueur Visual Studio ne s’arrête pas à un point d’arrêt dans une méthode marquée avec l’attribut DebuggerStepThroughAttribute .

  • Si JMC est désactivé, le débogueur s’arrête au point d’arrêt même si la méthode est marquée avec le DebuggerStepThroughAttribute.

Le code suivant montre comment le compilateur Visual Basic utilise l’attribut.

<System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        components = New System.ComponentModel.Container()
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.Text = "Form1"
    End Sub

Cet attribut évite d’avoir à passer au code fourni par le compilateur et uniquement aux étapes du code fourni par le développeur. Par exemple, si vous effectuez un pas à pas dans le code à l’aide de la clé F11 (Pas à pas), l’attribut entraîne le comportement de l’étape comme une clé F10 (Pas à pas) pour le code fourni par le compilateur. La méthode ne sera pas intégrée, mais elle sera exécutée.

Pour plus d’informations sur l’utilisation d’attributs, consultez Attributs.

Constructeurs

Nom Description
DebuggerStepThroughAttribute()

Initialise une nouvelle instance de la classe DebuggerStepThroughAttribute.

Propriétés

Nom Description
TypeId

En cas d’implémentation dans une classe dérivée, obtient un identificateur unique pour cette Attribute.

(Hérité de Attribute)

Méthodes

Nom Description
Equals(Object)

Retourne une valeur qui indique si cette instance est égale à un objet spécifié.

(Hérité de Attribute)
GetHashCode()

Retourne le code de hachage pour cette instance.

(Hérité de Attribute)
GetType()

Obtient la Type de l’instance actuelle.

(Hérité de Object)
IsDefaultAttribute()

En cas de substitution dans une classe dérivée, indique si la valeur de cette instance est la valeur par défaut de la classe dérivée.

(Hérité de Attribute)
Match(Object)

En cas de substitution dans une classe dérivée, retourne une valeur qui indique si cette instance est égale à un objet spécifié.

(Hérité de Attribute)
MemberwiseClone()

Crée une copie superficielle du Objectactuel.

(Hérité de Object)
ToString()

Retourne une chaîne qui représente l’objet actuel.

(Hérité de Object)

Implémentations d’interfaces explicites

Nom Description
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Mappe un jeu de noms avec un jeu correspondant d'identificateurs de dispatch.

(Hérité de Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Récupère les informations de type d’un objet, qui peuvent être utilisées pour obtenir les informations de type d’une interface.

(Hérité de Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Récupère le nombre d'interfaces d'informations de type fourni par un objet (0 ou 1).

(Hérité de Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Fournit l’accès aux propriétés et méthodes exposées par un objet.

(Hérité de Attribute)

S’applique à