MemberInfo.GetCustomAttributesData メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
ターゲット メンバーに適用されている属性に関するデータを表す 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 参照してください。
このメソッドは、型メンバーを表す名前空間内のクラスとクラスがすべて派生MemberInfoするためType、型、入れ子になった型、および型メンバーのSystem.Reflectionカスタム属性データを取得します。