このプロパティに attributeType のインスタンスが 1 つ以上定義されているかどうかを示します。
Overrides Public Function IsDefined( _
ByVal attributeType As Type, _ ByVal inherit As Boolean _) As Boolean Implements ICustomAttributeProvider.IsDefined
[C#]
public override bool IsDefined(TypeattributeType,boolinherit);
[C++]
public: bool IsDefined(Type* attributeType,boolinherit);
[JScript]
public override function IsDefined(
attributeType : Type,inherit : Boolean) : Boolean;
パラメータ
- attributeType
カスタム属性を適用する対象の Type オブジェクト。 - inherit
このプロパティの継承チェインを検索して、カスタム属性を見つけるかどうかを指定します。
戻り値
このプロパティに attributeType のインスタンスが 1 つ以上定義されている場合は true 。それ以外の場合は false 。
実装
ICustomAttributeProvider.IsDefined
例外
例外の種類 | 条件 |
---|---|
NotSupportedException | このメソッドはサポートされていません。 |
解説
Type.GetType または Assembly.GetType を使用してプロパティの親の型にリフレクションし、型から Reflection プロパティ オブジェクトを取得し、PropertyInfo.IsDefined を呼び出します。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
PropertyBuilder クラス | PropertyBuilder メンバ | System.Reflection.Emit 名前空間