_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

傳回

如果一或多個 attributeType 參數的執行個體套用至這個成員,則為 true,否則為 false

備註

這個方法適用于從 Unmanaged 程式碼存取 Managed 類別,不應從 Managed 程式碼呼叫。

方法 IsDefined 會指出參數的 attributeType 一或多個實例是否套用至這個成員。

適用於