ICustomAttributeProvider.IsDefined(Type, Boolean) 方法

定义

指示是否在该成员上定义了一个或多个 attributeType 实例。Indicates whether one or more instance of attributeType is defined on this member.

public:
 bool IsDefined(Type ^ attributeType, bool inherit);
public bool IsDefined (Type attributeType, bool inherit);
abstract member IsDefined : Type * bool -> bool
Public Function IsDefined (attributeType As Type, inherit As Boolean) As Boolean

参数

attributeType
Type

自定义属性的类型。The type of the custom attributes.

inherit
Boolean

true 时,查找继承的自定义特性的层次结构链。When true, look up the hierarchy chain for the inherited custom attribute.

返回

Boolean

如果在该成员上定义 attributeType,则为 true;否则为 falsetrue if the attributeType is defined on this member; false otherwise.

适用于