語言

_Type.GetCustomAttributes 方法

定義

提供 COM 物件對該方法的版本無關存取 GetCustomAttributes 權。

多載

名稱 Description
GetCustomAttributes(Boolean)

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

GetCustomAttributes(Type, Boolean)

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

備註

此方法用於從非受管理程式碼存取受管理類別,不應從受管理程式碼呼叫。

該 MemberInfo.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

指定是否要搜尋該成員的繼承鏈以尋找屬性。

傳回

Object[]

該成員需套用自訂屬性陣列,若未套用屬性則為零(0)元素。

備註

此方法用於從非受管理程式碼存取受管理類別,不應從受管理程式碼呼叫。

該 Assembly.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

要搜尋的屬性類型。 只有可指派到此類型的屬性才會回傳。

inherit
Boolean

指定是否要搜尋該成員的繼承鏈以尋找屬性。

傳回

Object[]

該成員需套用自訂屬性陣列,若未套用屬性則為零(0)元素。

備註

此方法用於從非受管理程式碼存取受管理類別,不應從受管理程式碼呼叫。

該 MemberInfo.GetCustomAttributes 方法會回傳套用到該成員的所有屬性。

適用於