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

基底クラスからのカスタム属性の継承を制御します。

戻り値

このフィールドに attributeType のインスタンスが 1 つ以上定義されている場合は true。それ以外の場合は false

例外

このメソッドは現在サポートされていません。 GetField(String, BindingFlags) を使用してフィールドを取得し、返された IsDefined(Type, Boolean) に対して FieldInfo を呼び出します。

適用対象