Udostępnij za pośrednictwem


DebuggerStepThroughAttribute Klasa

Definicja

Instruuje debuger, aby przechodził przez kod zamiast przechodzić do kodu. Tej klasy nie można dziedziczyć.

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
Dziedziczenie
DebuggerStepThroughAttribute
Atrybuty

Uwagi

Ten atrybut jest udostępniany do użycia przez debugery kodu źródłowego; środowisko uruchomieniowe języka wspólnego nie ma na to wpływu. Na przykład debuger programu Visual Studio nie zatrzymuje się w metodzie oznaczonej tym atrybutem, nawet jeśli punkt przerwania jest ustawiony w metodzie .

Atrybut DebuggerStepThroughAttribute ma wpływ na funkcję Just My Code (JMC) programu Visual Studio w następujący sposób:

  • Jeśli pakiet JMC jest włączony, debuger programu Visual Studio nie zatrzyma się w punkcie przerwania w metodzie oznaczonej atrybutem DebuggerStepThroughAttribute .

  • Jeśli JMC jest wyłączona, debuger zatrzymuje się w punkcie przerwania, nawet jeśli metoda jest oznaczona za DebuggerStepThroughAttributepomocą .

Poniższy kod pokazuje, jak kompilator języka Visual Basic używa atrybutu .

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

Ten atrybut pozwala uniknąć konieczności przechodzenia do kodu dostarczonego przez kompilator i tylko kroków do kodu dostarczonego przez dewelopera. Jeśli na przykład przechodzisz przez kod przy użyciu klucza F11 (Krok do), atrybut spowoduje zachowanie kroku takiego jak klucz F10 (Krok do kroku) dla kodu dostarczonego przez kompilator. Metoda nie zostanie wejdą do metody, ale zostanie wykonana.

Aby uzyskać więcej informacji na temat używania atrybutów, zobacz Atrybuty.

Konstruktory

Nazwa Opis
DebuggerStepThroughAttribute()

Inicjuje nowe wystąpienie klasy DebuggerStepThroughAttribute.

Właściwości

Nazwa Opis
TypeId

Po zaimplementowaniu w klasie pochodnej pobiera unikatowy identyfikator dla tego Attribute.

(Odziedziczone po Attribute)

Metody

Nazwa Opis
Equals(Object)

Zwraca wartość wskazującą, czy to wystąpienie jest równe określonemu obiektowi.

(Odziedziczone po Attribute)
GetHashCode()

Zwraca kod skrótu dla tego wystąpienia.

(Odziedziczone po Attribute)
GetType()

Pobiera Type bieżącego wystąpienia.

(Odziedziczone po Object)
IsDefaultAttribute()

Po zastąpieniu w klasie pochodnej wskazuje, czy wartość tego wystąpienia jest wartością domyślną dla klasy pochodnej.

(Odziedziczone po Attribute)
Match(Object)

Po zastąpieniu w klasie pochodnej zwraca wartość wskazującą, czy to wystąpienie jest równe określonemu obiektowi.

(Odziedziczone po Attribute)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Object.

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Jawne implementacje interfejsu

Nazwa Opis
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Zestaw nazw jest mapowany na odpowiedni zestaw identyfikatorów wysyłania.

(Odziedziczone po Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Pobiera informacje o typie obiektu, którego można użyć do uzyskania informacji o typie dla interfejsu.

(Odziedziczone po Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Pobiera informację o liczbie typów interfejsów, jakie zawiera obiekt (0 lub 1).

(Odziedziczone po Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Zapewnia dostęp do właściwości i metod uwidocznionych przez obiekt.

(Odziedziczone po Attribute)

Dotyczy