ConstructorBuilder.IsDefined(Type, Boolean) 方法

定義

檢查是否已定義指定的自訂屬性類型。

public:
 override bool IsDefined(Type ^ attributeType, bool inherit);
public override bool IsDefined (Type attributeType, bool inherit);
override this.IsDefined : Type * bool -> bool
Public Overrides Function IsDefined (attributeType As Type, inherit As Boolean) As Boolean

參數

attributeType
Type

自訂屬性類型。

inherit
Boolean

控制自訂屬性來自基底類別的繼承。 這個參數已忽略。

傳回

如果已定義指定的自訂屬性類型,則為 true,否則為 false

例外狀況

目前不支援這個方法。 您可以使用 GetConstructor(BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) 並在傳回的 ConstructorInfo 呼叫 IsDefined(Type, Boolean),藉此擷取建構函式。

備註

如需如何格式化 binaryAttribute的詳細資訊,請參閱元數據規格。

適用於