DebuggerStepThroughAttribute Klasa

Definicja

Instruuje debugera, aby przechodził przez kod zamiast przechodzić do kodu. Klasa ta nie może być dziedziczona.

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 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) Visual Studio w następujący sposób:

  • Jeśli funkcja JMC jest włączona, debuger 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 pomocą DebuggerStepThroughAttributepolecenia .

Poniższy kod pokazuje, jak kompilator 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 unika 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 (Step Into), atrybut spowoduje, że krok będzie zachowywać się jak klucz F10 (Krok powyżej) dla kodu dostarczonego przez kompilator. Metoda nie zostanie wejdą w jej działanie, ale zostanie wykonana.

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

Konstruktory

DebuggerStepThroughAttribute()

Inicjuje nowe wystąpienie klasy DebuggerStepThroughAttribute.

Właściwości

TypeId

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

(Odziedziczone po Attribute)

Metody

Equals(Object)

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

(Odziedziczone po Attribute)
GetHashCode()

Zwraca wartość skrótu dla tego wystąpienia.

(Odziedziczone po Attribute)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
IsDefaultAttribute()

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

(Odziedziczone po Attribute)
Match(Object)

Po przesłonięciu 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 Objectelementu .

(Odziedziczone po Object)
ToString()

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

(Odziedziczone po Object)

Jawne implementacje interfejsu

_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 dla obiektu, który może służyć do pobierania 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)

Umożliwia dostęp do właściwości i metod udostępnianych przez obiekt.

(Odziedziczone po Attribute)

Dotyczy