PropertyBuilder.IsDefined(Type, Boolean) 方法

定义

指示是否对此属性定义了一个或多个实例 attributeType

public:
 override bool IsDefined(Type ^ attributeType, bool inherit);
public override bool IsDefined(Type attributeType, bool inherit);
override this.IsDefined : Type * bool -> bool
Public Overrides Function IsDefined (attributeType As Type, inherit As Boolean) As Boolean

参数

attributeType
Type

应用 Type 自定义属性的对象。

inherit
Boolean

指定是否遍查此属性的继承链以查找自定义属性。

返回

true 如果对此属性定义了一个或多个实例, attributeType 则为 ;否则为 false

例外

不支持此方法。

注解

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

适用于