InheritanceAttribute 類別

定義

指示與這個屬性相關的元件是否已經繼承自基底類別。Indicates whether the component associated with this attribute has been inherited from a base class. 這個類別無法被繼承。This class cannot be inherited.

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

備註

InheritanceAttribute 代表成員的繼承類型和層級。InheritanceAttribute represents the type and level of inheritance of a member.

IInheritanceServiceAddInheritedComponents 方法搜尋元件的元件欄位以識別繼承自基類的欄位時,此方法會使用 InheritanceAttribute來表示每個元件的繼承層級。When the AddInheritedComponents method of the IInheritanceService searches the component fields of a component to identify fields that are inherited from a base class, the method represents the inheritance level of each component using an InheritanceAttribute.

建構函式

InheritanceAttribute()

InheritanceAttribute 類別的新執行個體初始化。Initializes a new instance of the InheritanceAttribute class.

InheritanceAttribute(InheritanceLevel)

使用指定的繼承層級,初始化 InheritanceAttribute 類別的新執行個體。Initializes a new instance of the InheritanceAttribute class with the specified inheritance level.

欄位

Default

指定 InheritanceAttribute 的預設值為 NotInheritedSpecifies that the default value for InheritanceAttribute is NotInherited. 此欄位是唯讀的。This field is read-only.

Inherited

指定元件已繼承。Specifies that the component is inherited. 此欄位是唯讀的。This field is read-only.

InheritedReadOnly

指定元件已繼承且為唯讀。Specifies that the component is inherited and is read-only. 此欄位是唯讀的。This field is read-only.

NotInherited

指定元件並未繼承。Specifies that the component is not inherited. 此欄位是唯讀的。This field is read-only.

屬性

InheritanceLevel

取得或設定儲存在這個屬性中的目前繼承層級。Gets or sets the current inheritance level stored in this attribute.

TypeId

在衍生類別中實作時,取得這個 Attribute 的唯一識別碼。When implemented in a derived class, gets a unique identifier for this Attribute.

(繼承來源 Attribute)

方法

Equals(Object)

覆寫以測試是否相等。Override to test for equality.

GetHashCode()

傳回這個物件的雜湊程式碼。Returns the hashcode for this object.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
IsDefaultAttribute()

取得值,指出目前屬性值是否為屬性的預設值。Gets a value indicating whether the current value of the attribute is the default value for the attribute.

Match(Object)

在衍生類別中覆寫時,會傳回值,表示這個執行個體是否等於指定物件。When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.

(繼承來源 Attribute)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

將這個屬性轉換成字串。Converts this attribute to a string.

明確介面實作

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

將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。Maps a set of names to a corresponding set of dispatch identifiers.

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

擷取物件的類型資訊,可以用來取得介面的類型資訊。Retrieves the type information for an object, which can be used to get the type information for an interface.

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

擷取物件提供的類型資訊介面數目 (0 或 1)。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

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

提供物件所公開的屬性和方法的存取權。Provides access to properties and methods exposed by an object.

(繼承來源 Attribute)

適用於

另請參閱