DebuggerStepThroughAttribute Classe

Definizione

Indica al debugger di eseguire il codice invece di eseguire istruzioni nel codice. Questa classe non può essere ereditata.

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
Ereditarietà
DebuggerStepThroughAttribute
Attributi

Commenti

Questo attributo viene fornito per l'uso da parte dei debugger del codice sorgente; Common Language Runtime non è interessato da esso. Ad esempio, il debugger di Visual Studio non si arresta in un metodo contrassegnato con questo attributo anche se nel metodo è impostato un punto di interruzione.

L'attributo DebuggerStepThroughAttribute influisce sulla funzionalità Just My Code (JMC) di Visual Studio nei modi seguenti:

  • Se JMC è abilitato, il debugger di Visual Studio non si arresterà in corrispondenza di un punto di interruzione in un metodo contrassegnato con l'attributo DebuggerStepThroughAttribute .

  • Se JMC è disabilitato, il debugger si arresta in corrispondenza del punto di interruzione anche se il metodo è contrassegnato con .DebuggerStepThroughAttribute

Nel codice seguente viene illustrato come il compilatore di Visual Basic usa l'attributo .

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

Questo attributo evita di dover eseguire istruzioni nel codice fornito dal compilatore e di eseguire solo passaggi nel codice fornito dallo sviluppatore. Ad esempio, se si esegue l'istruzione del codice usando la chiave F11 (Esegui istruzione in ingresso), l'attributo causerà il comportamento del passaggio come una chiave F10 (istruzione/istruzione) per il codice fornito dal compilatore. Il metodo non verrà eseguito, ma verrà eseguito.

Per altre informazioni sull'uso degli attributi, vedere Attributi.

Costruttori

Nome Descrizione
DebuggerStepThroughAttribute()

Inizializza una nuova istanza della classe DebuggerStepThroughAttribute.

Proprietà

Nome Descrizione
TypeId

Se implementato in una classe derivata, ottiene un identificatore univoco per questo Attribute.

(Ereditato da Attribute)

Metodi

Nome Descrizione
Equals(Object)

Restituisce un valore che indica se questa istanza è uguale a un oggetto specificato.

(Ereditato da Attribute)
GetHashCode()

Restituisce il codice hash per questa istanza.

(Ereditato da Attribute)
GetType()

Ottiene il Type dell'istanza corrente.

(Ereditato da Object)
IsDefaultAttribute()

Quando sottoposto a override in una classe derivata, indica se il valore di questa istanza è il valore predefinito per la classe derivata.

(Ereditato da Attribute)
Match(Object)

Quando sottoposto a override in una classe derivata, restituisce un valore che indica se questa istanza è uguale a un oggetto specificato.

(Ereditato da Attribute)
MemberwiseClone()

Crea una copia superficiale del Objectcorrente.

(Ereditato da Object)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Implementazioni dell'interfaccia esplicita

Nome Descrizione
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Esegue il mapping di un set di nomi a un set corrispondente di identificatori dispatch.

(Ereditato da Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Recupera le informazioni sul tipo per un oggetto, che può essere utilizzato per ottenere le informazioni sul tipo per un'interfaccia.

(Ereditato da Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Recupera il numero di interfacce di informazioni sul tipo fornite da un oggetto (0 o 1).

(Ereditato da Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Fornisce l'accesso alle proprietà e ai metodi esposti da un oggetto .

(Ereditato da Attribute)

Si applica a