次の方法で共有


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

派生クラスによってオーバーライドされた場合、 Type で識別されるカスタム属性の配列を返します。

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

パラメータ

  • attributeType
    検索する属性の型。この型に割り当てることができる属性だけが返されます。
  • inherit
    このメンバの継承チェインを検索して属性を見つけるかどうかを指定します。

戻り値

リフレクションされたメンバに定義されているカスタム属性の配列。定義されている属性がない場合は、要素がゼロ (0) の配列。

実装

ICustomAttributeProvider.GetCustomAttributes

例外

例外の種類 条件
TypeLoadException カスタム属性の型を読み込むことができません。

必要条件

プラットフォーム: 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

参照

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