TypeDelegator.IsDefined(Type, Boolean) 方法

定义

指示是否定义由 attributeType 标识的自定义属性。Indicates whether a custom attribute identified by attributeType 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

指定是否搜索此类型的继承链以查找这些属性。Specifies whether to search this type's inheritance chain to find the attributes.

inherit
Boolean

由类型标识的自定义属性数组。An array of custom attributes identified by type.

返回

如果定义由 attributeType 标识的自定义属性,则为 true;否则为 falsetrue if a custom attribute identified by attributeType is defined; otherwise, false.

异常

attributeTypenullattributeType is null.

无法加载自定义特性类型。The custom attribute type cannot be loaded.

适用于