DebuggerStepThroughAttribute Klasa

Definicja

Wskazuje debugerowi, aby podczas wykonywania krokowego przechodził przez kod zamiast wchodzić do niego. 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 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 funkcja JMC jest włączona, 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 pomocą DebuggerStepThroughAttributepolecenia .

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 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 elementu Attribute.

(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 bieżące wystąpienie.

(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)

W przypadku zastąpienia 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 obiektu, którego można użyć do pobrania informacji o typie 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