Share via


ReflectedControllerDescriptor.GetCustomAttributes 方法

定義

多載

GetCustomAttributes(Boolean)

傳回針對此成員定義的自訂屬性陣列,但不包括具名屬性。

GetCustomAttributes(Type, Boolean)

傳回針對此成員定義的自訂屬性陣列,並依型別識別。

GetCustomAttributes(Boolean)

傳回針對此成員定義的自訂屬性陣列,但不包括具名屬性。

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

參數

inherit
Boolean

true 表示查閱繼承自訂屬性的階層鏈結;否則為 false。

傳回

Object[]

自訂屬性的陣列,如果自訂屬性不存在則為空陣列。

例外狀況

無法載入自訂屬性類型。

針對這個成員定義了一個以上的類型 attributeType 屬性。

適用於

GetCustomAttributes(Type, Boolean)

傳回針對此成員定義的自訂屬性陣列,並依型別識別。

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

true 表示查閱繼承自訂屬性的階層鏈結;否則為 false。

傳回

Object[]

自訂屬性的陣列,如果自訂屬性不存在則為空陣列。

例外狀況

無法載入自訂屬性類型。

針對這個成員定義了一個以上的類型 attributeType 屬性。

適用於