MemberInfo.GetCustomAttributesData メソッド

定義

ターゲット メンバーに適用 CustomAttributeData 属性に関するデータを表すオブジェクトの一覧を返します。

public:
 virtual System::Collections::Generic::IList<System::Reflection::CustomAttributeData ^> ^ GetCustomAttributesData();
public virtual System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributesData();
abstract member GetCustomAttributesData : unit -> System.Collections.Generic.IList<System.Reflection.CustomAttributeData>
override this.GetCustomAttributesData : unit -> System.Collections.Generic.IList<System.Reflection.CustomAttributeData>
Public Overridable Function GetCustomAttributesData () As IList(Of CustomAttributeData)

返品

ターゲット メンバーに適用されている属性に関するデータを表す CustomAttributeData オブジェクトの汎用リスト。

注釈

リフレクションのみのコンテキストに読み込まれるコードでカスタム属性自体が定義されている場合に、リフレクションのみのコンテキストでコードのカスタム属性を調べるには、このメソッドを使用します。 Attribute.GetCustomAttributesMemberInfo.GetCustomAttributesなどのメソッドは、属性のインスタンスを作成するため、このような場合は使用できません。 リフレクションのみのコンテキスト内のコードは実行できません。 詳細とコード例については、 CustomAttributeData クラスを参照してください。

このメソッドは、型、入れ子になった型、および型メンバーのカスタム属性データを取得します。これは、 Type クラスと、型メンバーを表す System.Reflection 名前空間内のクラスがすべて MemberInfoから派生するためです。

適用対象