_Type.IsDefined(Type, Boolean) 方法

定义

为 COM 对象提供对 IsDefined(Type, Boolean) 方法的与版本无关的访问。

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

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

inherit
Boolean

指定是否搜索此成员的继承链以查找属性。

返回

如果此成员应用了一个或多个 attributeType 实例,则为 true;否则为 false

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

方法 MemberInfo.IsDefined 指示 是否将 的 attributeType 一个或多个实例应用于此成员。

适用于