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.

傳回

如果此成員上已定義 attributeType,則為 true,否則為 falsetrue if the attributeType is defined on this member; false otherwise.

適用於