_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

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

返回

如果对此成员应用了一个或多个实例 ,则为 ;否则为 < a1/>

注解

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

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

适用于