ControllerDescriptor.GetCustomAttributes 方法

定义

重载

GetCustomAttributes(Boolean)

检索为此成员定义的自定义特性,指定的特性除外。

GetCustomAttributes(Type, Boolean)

检索为此成员定义的指定类型的自定义特性(指定的特性除外)。

GetCustomAttributes(Boolean)

检索为此成员定义的自定义特性,指定的特性除外。

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

参数

inherit
Boolean

如果为 true,则查找继承的自定义属性的层次结构链;否则为 false。

返回

Object[]

自定义特性的数组,如果没有自定义特性,则为空数组。

实现

例外

无法加载自定义特性类型。

为此成员定义了多个类型的 attributeType 属性。

适用于

GetCustomAttributes(Type, Boolean)

检索为此成员定义的指定类型的自定义特性(指定的特性除外)。

public virtual object[] GetCustomAttributes (Type attributeType, bool inherit);
abstract member GetCustomAttributes : Type * bool -> obj[]
override this.GetCustomAttributes : Type * bool -> obj[]
Public Overridable Function GetCustomAttributes (attributeType As Type, inherit As Boolean) As Object()

参数

attributeType
Type

自定义属性的类型。

inherit
Boolean

如果为 true,则查找继承的自定义属性的层次结构链;否则为 false。

返回

Object[]

自定义特性的数组,如果没有自定义特性,则为空数组。

实现

例外

无法加载自定义特性类型。

为此成员定义了多个类型的 attributeType 属性。

参数 attributeType 为 null (Visual Basic) 中为 Nothing。

适用于