TypeDelegator.GetCustomAttributes 方法

定義

傳回為這個類型定義的所有自訂屬性。

多載

GetCustomAttributes(Boolean)

傳回為這個型別定義的所有自訂屬性,指定是否搜尋型別的繼承 (Inheritance) 鏈結。

GetCustomAttributes(Type, Boolean)

傳回由型別識別的自訂屬性陣列。

GetCustomAttributes(Boolean)

來源:
TypeDelegator.cs
來源:
TypeDelegator.cs
來源:
TypeDelegator.cs

傳回為這個型別定義的所有自訂屬性,指定是否搜尋型別的繼承 (Inheritance) 鏈結。

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

參數

inherit
Boolean

指定是否搜尋這個型別的繼承鏈結以尋找屬性。

傳回

Object[]

物件的陣列包含為這個型別定義的所有自訂屬性。

例外狀況

無法載入自訂屬性型別。

適用於

GetCustomAttributes(Type, Boolean)

來源:
TypeDelegator.cs
來源:
TypeDelegator.cs
來源:
TypeDelegator.cs

傳回由型別識別的自訂屬性陣列。

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

參數

attributeType
Type

由型別識別的自訂屬性陣列。

inherit
Boolean

指定是否搜尋這個型別的繼承鏈結以尋找屬性。

傳回

Object[]

物件的陣列包含這個型別中定義的自訂屬性,而這些屬性符合 attributeType 參數,指定是否搜尋型別的繼承鏈結,或是如果這個型別上沒有定義自訂屬性,則為 null

例外狀況

attributeTypenull

無法載入自訂屬性型別。

適用於