_Assembly.GetCustomAttributes 方法

定義

為 COM 物件提供與版本無關的 GetCustomAttributes 方法之存取權。

多載

GetCustomAttributes(Type, Boolean)

為 COM 物件提供與版本無關的 GetCustomAttributes(Type, Boolean) 方法之存取權。

GetCustomAttributes(Boolean)

為 COM 物件提供與版本無關的 GetCustomAttributes(Boolean) 方法之存取權。

備註

此方法適用於從 Unmanaged 程式代碼存取 Managed 類別,不應從 Managed 程式代碼呼叫。

方法 GetCustomAttributes 會取得這個元件的自定義屬性。

GetCustomAttributes(Type, Boolean)

為 COM 物件提供與版本無關的 GetCustomAttributes(Type, Boolean) 方法之存取權。

public:
 cli::array <System::Object ^> ^ GetCustomAttributes(Type ^ attributeType, bool inherit);
public object[] GetCustomAttributes (Type attributeType, bool inherit);
abstract member GetCustomAttributes : Type * bool -> obj[]
Public Function GetCustomAttributes (attributeType As Type, inherit As Boolean) As Object()

參數

attributeType
Type

要為其傳回自訂屬性的 Type

inherit
Boolean

Assembly 類型的物件會忽略這個引數。

傳回

Object[]

Object 類型的陣列,包含這個組件由 attributeType 指定的自訂屬性。

備註

此方法適用於從 Unmanaged 程式代碼存取 Managed 類別,不應從 Managed 程式代碼呼叫。

方法 GetCustomAttributes 會取得這個元件的所有自定義屬性。

另請參閱

適用於

GetCustomAttributes(Boolean)

為 COM 物件提供與版本無關的 GetCustomAttributes(Boolean) 方法之存取權。

public:
 cli::array <System::Object ^> ^ GetCustomAttributes(bool inherit);
public object[] GetCustomAttributes (bool inherit);
abstract member GetCustomAttributes : bool -> obj[]
Public Function GetCustomAttributes (inherit As Boolean) As Object()

參數

inherit
Boolean

Assembly 類型的物件會忽略這個引數。

傳回

Object[]

Object 類型的陣列,包含這個組件的自訂屬性。

備註

此方法適用於從 Unmanaged 程式代碼存取 Managed 類別,不應從 Managed 程式代碼呼叫。

方法 GetCustomAttributes 會取得這個元件的所有自定義屬性。

另請參閱

適用於