DebuggerNonUserCodeAttribute 類別

定義

識別不屬於應用程式之使用者程式碼的類型或成員。

public ref class DebuggerNonUserCodeAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
public sealed class DebuggerNonUserCodeAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public sealed class DebuggerNonUserCodeAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)>]
type DebuggerNonUserCodeAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type DebuggerNonUserCodeAttribute = class
    inherit Attribute
Public NotInheritable Class DebuggerNonUserCodeAttribute
Inherits Attribute
繼承
DebuggerNonUserCodeAttribute
屬性

範例

下列程式代碼範例示範在 Visual Basic 專案中使用這個屬性。

' Form overrides Dispose to clean up the component list.  
<System.Diagnostics.DebuggerNonUserCode()> _  
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)  
    If disposing AndAlso components IsNot Nothing Then  
        components.Dispose()  
    End If  
    MyBase.Dispose(disposing)  
End Sub  

備註

Designer 提供的型別和成員不屬於用戶特別建立的程式代碼,可能會使偵錯體驗複雜。 這個屬性會隱藏調試程式視窗中這些相鄰類型和成員的顯示,並自動逐步執行,而不是逐步執行設計工具提供的程序代碼。 當調試程式在逐步執行用戶程式代碼時遇到這個屬性時,用戶體驗不會看到設計工具提供的程式碼,以及逐步執行下一個使用者提供的程式代碼語句。

注意

Common Language Runtime 不會附加任何語意至這個屬性。 它可供原始程式碼調試程式使用。 例如,在 Visual Studio 2005 中,調試程式不會在調試程式視窗中顯示具有此屬性的專案、不會停止於具有此屬性的方法中,而且不允許在 方法中設定斷點。

當 存在 時 DebuggerNonUserCodeAttribute ,的調試程式行為類似於使用 屬性的組合 DebuggerHiddenAttribute ,這會隱藏調試程式中的程序代碼,而 DebuggerStepThroughAttribute 屬性會指示調試程式逐步執行,而不是套用至的程序代碼。

建構函式

DebuggerNonUserCodeAttribute()

初始化 DebuggerNonUserCodeAttribute 類別的新執行個體。

屬性

TypeId

在衍生類別中實作時,取得這個 Attribute 的唯一識別碼。

(繼承來源 Attribute)

方法

Equals(Object)

傳回值,這個值指出此執行個體是否與指定的物件相等。

(繼承來源 Attribute)
GetHashCode()

傳回這個執行個體的雜湊碼。

(繼承來源 Attribute)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IsDefaultAttribute()

在衍生類別中覆寫時,表示這個執行個體的值是衍生類別的預設值。

(繼承來源 Attribute)
Match(Object)

在衍生類別中覆寫時,會傳回值,表示這個執行個體是否等於指定物件。

(繼承來源 Attribute)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

明確介面實作

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

將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。

(繼承來源 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

擷取物件的類型資訊,可以用來取得介面的類型資訊。

(繼承來源 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

擷取物件提供的類型資訊介面數目 (0 或 1)。

(繼承來源 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供物件所公開的屬性和方法的存取權。

(繼承來源 Attribute)

適用於