ConstructorBuilder.IsDefined(Type, Boolean) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
检查是否定义了指定的自定义属性类型。
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
自定义属性类型。
- inherit
- Boolean
控制从基类继承自定义属性。 忽略此参数。
返回
true 如果定义了指定的自定义属性类型,否则,为 false.
例外
目前不支持此方法。 可以使用和调用GetConstructor(BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])返回IsDefined(Type, Boolean)的构造函数来检索构造函数ConstructorInfo。
注解
有关如何设置格式 binaryAttribute的详细信息,请参阅元数据规范。