Attribute.IsDefined メソッド (Assembly, Type)
指定した型のカスタム属性が、指定したアセンブリへ適用されているかどうかを判断します。
Overloads Public Shared Function IsDefined( _
ByVal element As Assembly, _ ByVal attributeType As Type _) As Boolean
[C#]
public static bool IsDefined(Assemblyelement,TypeattributeType);
[C++]
public: static bool IsDefined(Assembly* element,Type* attributeType);
[JScript]
public static function IsDefined(
element : Assembly,attributeType : Type) : Boolean;
パラメータ
- element
モジュールの再利用可能でバージョン管理可能なコレクションを記述する Assembly クラスから派生したオブジェクト。 - attributeType
カスタム属性を適用する対象の Type オブジェクト。
戻り値
attributeType 型のカスタム属性が element に適用される場合は true 。それ以外の場合は false 。
例外
例外の種類 | 条件 |
---|---|
ArgumentNullException | element または attributeType が null 参照 (Visual Basic では Nothing) です。 |
ArgumentException | attributeType が Attribute から派生していません。 |
解説
element の祖先のカスタム属性は検索されません。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET, Common Language Infrastructure (CLI) Standard
参照
Attribute クラス | Attribute メンバ | System 名前空間 | Attribute.IsDefined オーバーロードの一覧