次の方法で共有


Attribute.IsDefined メソッド (Module, Type)

指定した型のカスタム属性が、指定したモジュールへ適用されているかどうかを判断します。

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

パラメータ

  • element
    ポータブル実行可能 (PE) ファイルを記述する Module クラスから派生したオブジェクト。
  • attributeType
    カスタム属性を適用する対象の Type オブジェクト。

戻り値

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

例外

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

解説

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 オーバーロードの一覧