InheritanceAttribute 類別

定義

指示與這個屬性相關的元件是否已經繼承自基底類別。 此類別無法獲得繼承。

public ref class InheritanceAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Property)]
public sealed class InheritanceAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Property)>]
type InheritanceAttribute = class
    inherit Attribute
Public NotInheritable Class InheritanceAttribute
Inherits Attribute
繼承
InheritanceAttribute
屬性

備註

InheritanceAttribute 表示成員的型別和繼承層級。

當 的 AddInheritedComponentsIInheritanceService 方法搜尋元件的元件欄位以識別繼承自基類的欄位時,此方法會使用 InheritanceAttribute 來表示每個元件的繼承層級。

建構函式

InheritanceAttribute()

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

InheritanceAttribute(InheritanceLevel)

使用指定的繼承層級,初始化 InheritanceAttribute 類別的新執行個體。

欄位

Default

指定 InheritanceAttribute 的預設值為 NotInherited。 此欄位為唯讀。

Inherited

指定元件已繼承。 此欄位為唯讀。

InheritedReadOnly

指定元件已繼承且為唯讀。 此欄位為唯讀。

NotInherited

指定元件並未繼承。 此欄位為唯讀。

屬性

InheritanceLevel

取得或設定儲存在這個屬性中的目前繼承層級。

TypeId

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

(繼承來源 Attribute)

方法

Equals(Object)

覆寫以測試是否相等。

GetHashCode()

傳回這個物件的雜湊程式碼。

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IsDefaultAttribute()

取得值,指出目前屬性值是否為屬性的預設值。

Match(Object)

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

(繼承來源 Attribute)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

將這個屬性轉換成字串。

明確介面實作

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

適用於

另請參閱