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)

戻り値

IList<CustomAttributeData>

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

注釈

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

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

適用対象