_Type.IsDefined(Type, Boolean) _Type.IsDefined(Type, Boolean) _Type.IsDefined(Type, Boolean) _Type.IsDefined(Type, Boolean) Method

定義

為 COM 物件提供與版本無關的 IsDefined(Type, Boolean) 方法之存取權。Provides COM objects with version-independent access to the IsDefined(Type, Boolean) method.

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 Type Type

套用自訂屬性的 Type 物件。The Type object to which the custom attributes are applied.

inherit
Boolean Boolean Boolean Boolean

指定是否要搜尋這個成員的繼承鏈結以尋找屬性。Specifies whether to search this member's inheritance chain to find the attributes.

傳回

如果一或多個 attributeType 的執行個體套用至這個成員,則為 true;否則為 falsetrue if one or more instance of attributeType is applied to this member; otherwise, false.

備註

這個方法會從 unmanaged 程式碼,是用於存取 managed 類別,並不會呼叫從 managed 程式碼。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

MemberInfo.IsDefined方法會指出是否有一或多個執行個體attributeType套用至這個成員。The MemberInfo.IsDefined method indicates whether one or more instance of attributeType is applied to this member.

適用於