次の方法で共有


TypeBuilder.GetCustomAttributes メソッド (Type, Boolean)

指定されたカスタム属性の型が定義されているかどうかを確認します。

Overrides Overloads Public Function GetCustomAttributes( _
   ByVal attributeType As Type, _   ByVal inherit As Boolean _) As Object() Implements ICustomAttributeProvider.GetCustomAttributes
[C#]
public override object[] GetCustomAttributes(TypeattributeType,boolinherit);
[C++]
public: Object* GetCustomAttributes(Type* attributeType,boolinherit)  __gc[];
[JScript]
public override function GetCustomAttributes(
   attributeType : Type,inherit : Boolean) : Object[];

パラメータ

  • attributeType
    カスタム属性を適用する対象の Type オブジェクト。
  • inherit
    このメンバの継承チェインを検索して属性を見つけるかどうかを指定します。

戻り値

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

実装

ICustomAttributeProvider.GetCustomAttributes

例外

例外の種類 条件
NotSupportedException このメソッドは現在、不完全な型に対してはサポートされていません。 GetType を使用して型を取得し、返された Type に対して GetCustomAttributes を呼び出します。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

TypeBuilder クラス | TypeBuilder メンバ | System.Reflection.Emit 名前空間 | TypeBuilder.GetCustomAttributes オーバーロードの一覧