ControllerDescriptor.IsDefined(Type, Boolean) 方法

定义

检索一个值,该值指示是否为此成员定义指定的自定义特性的一个或多个实例。

public virtual bool IsDefined (Type attributeType, bool inherit);
abstract member IsDefined : Type * bool -> bool
override this.IsDefined : Type * bool -> bool
Public Overridable Function IsDefined (attributeType As Type, inherit As Boolean) As Boolean

参数

attributeType
Type

自定义特性的类型。

inherit
Boolean

如果为 true,则查找继承的自定义属性的层次结构链;否则为 false。

返回

如果为此成员定义 , attributeType 则为 true;否则为 false。

实现

例外

参数 attributeType 为 null (Visual Basic) 中无任何内容。

适用于