ConstructorBuilder.IsDefined(Type, Boolean) 方法

定义

检查是否定义了指定的自定义属性类型。Checks if the specified custom attribute type is defined.

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

自定义属性类型。A custom attribute type.

inherit
Boolean

基类中自定义属性的控件继承。Controls inheritance of custom attributes from base classes. 忽略此参数。This parameter is ignored.

返回

Boolean

如果定义了指定的自定义属性类型,则为 true;否则为 falsetrue if the specified custom attribute type is defined; otherwise, false.

例外

目前尚不支持此方法。This method is not currently supported. 你可以使用 GetConstructor(BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) 检索构造函数并在返回的 ConstructorInfo 上调用 IsDefined(Type, Boolean)You can retrieve the constructor using GetConstructor(BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) and call IsDefined(Type, Boolean) on the returned ConstructorInfo.

注解

有关如何格式化的详细信息,请参阅元数据规范 binaryAttributeSee the metadata specification for details on how to format binaryAttribute.

适用于