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

傳回

Boolean

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

備註

這個方法是用來從非受控碼存取 managed 類別,不應該從 managed 程式碼呼叫。

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

適用於