_Type.IsDefined(Type, Boolean) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供 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 若一個或多個 實 attributeType 例應用於該成員;否則, false。
備註
此方法用於從非受管理程式碼存取受管理類別,不應從受管理程式碼呼叫。
該 MemberInfo.IsDefined 方法會顯示是否對該成員套用一個或多個實例 attributeType 。