MemberInfo.GetCustomAttributesData Metoda

Definice

Vrátí seznam objektů CustomAttributeData představujících data o atributech, které byly použity u cílového členu.

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)

Návraty

IList<CustomAttributeData>

Obecný seznam objektů CustomAttributeData představujících data o atributech, které byly použity u cílového členu.

Poznámky

Pomocí této metody můžete prozkoumat vlastní atributy kódu v kontextu pouze reflexe v případech, kdy jsou vlastní atributy definovány v kódu, který je načten do kontextu pouze reflexe. V takových případech nelze použít metody jako a , protože vytvářejí Attribute.GetCustomAttributes MemberInfo.GetCustomAttributes instance atributů. Kód v kontextu pouze reflexe nelze spustit. Další informace a například kód najdete ve CustomAttributeData třídě .

Tato metoda získá data vlastního atributu pro typy, vnořené typy a členy typu, protože třída a třídy v oboru názvů, které představují členy typu, jsou odvozeny Type System.Reflection z třídy MemberInfo .

Platí pro