PropertyBuilder.GetCustomAttributes 方法

定义

返回此属性上定义的所有自定义属性。

重载

名称 说明
GetCustomAttributes(Boolean)

返回此属性的所有自定义属性的数组。

GetCustomAttributes(Type, Boolean)

返回由 Type. 标识的自定义属性数组。

GetCustomAttributes(Boolean)

返回此属性的所有自定义属性的数组。

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

如果 true,请遍查此属性的继承链以查找自定义属性。

返回

Object[]

所有自定义属性的数组。

例外

不支持此方法。

注解

使用 Type.GetType 或 Assembly.GetType 反映属性的父类型,从该类型中检索 Reflection 属性对象,并调用 PropertyInfo.GetCustomAttributes。

适用于

GetCustomAttributes(Type, Boolean)

返回由 Type. 标识的自定义属性数组。

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

如果 true,请遍查此属性的继承链以查找自定义属性。

返回

Object[]

在此反射成员上定义的自定义属性数组,或者 null 此成员上未定义任何属性。

例外

不支持此方法。

注解

使用 Type.GetType 或 Assembly.GetType 反映属性的父类型,从该类型中检索 Reflection 属性对象,并调用 PropertyInfo.GetCustomAttributes。

适用于