次の方法で共有


Attribute.IsDefined メソッド (Assembly, Type, Boolean)

指定した型のカスタム属性が、指定したアセンブリへ適用されているかどうかを判断します。

Overloads Public Shared Function IsDefined( _
   ByVal element As Assembly, _   ByVal attributeType As Type, _   ByVal inherit As Boolean _) As Boolean
[C#]
public static bool IsDefined(Assemblyelement,TypeattributeType,boolinherit);
[C++]
public: static bool IsDefined(Assembly* element,Type* attributeType,boolinherit);
[JScript]
public static function IsDefined(
   element : Assembly,attributeType : Type,inherit : Boolean) : Boolean;

パラメータ

  • element
    モジュールの再利用可能でバージョン管理可能なコレクションを記述する Assembly クラスから派生したオブジェクト。
  • attributeType
    カスタム属性を適用する対象の Type オブジェクト。
  • inherit
    このパラメータは無視され、このメソッドの動作には影響しません。

戻り値

attributeType 型のカスタム属性が element に適用される場合は true 。それ以外の場合は false

例外

例外の種類 条件
ArgumentNullException element または attributeType が null 参照 (Visual Basic では Nothing) です。
ArgumentException attributeTypeAttribute から派生していません。

解説

このメソッドは inherit パラメータの値を無視します。 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

参照

Attribute クラス | Attribute メンバ | System 名前空間 | Attribute.IsDefined オーバーロードの一覧