ReflectedActionDescriptor.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 属性。

适用于