_MemberInfo.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

true 若要搜索此成员的继承链以查找属性,则为 ;否则,为 false.

返回

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

注解

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

该方法 IsDefined 指示参数的一个或多个实例 attributeType 是否应用于此成员。

适用于