MemberInfo.GetCustomAttributesData Metoda

Definicja

Zwraca listę CustomAttributeData obiektów reprezentujących dane dotyczące atrybutów, które zostały zastosowane do elementu docelowego.

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)

Zwraca

IList<CustomAttributeData>

Ogólna lista CustomAttributeData obiektów reprezentujących dane dotyczące atrybutów, które zostały zastosowane do elementu członkowskiego docelowego.

Uwagi

Ta metoda służy do badania atrybutów niestandardowych kodu w kontekście tylko odbicia, w przypadkach, gdy same atrybuty niestandardowe są zdefiniowane w kodzie, który jest ładowany do kontekstu tylko odbicia. Metody takie jak Attribute.GetCustomAttributes i MemberInfo.GetCustomAttributes nie mogą być używane w takich przypadkach, ponieważ tworzą wystąpienia atrybutów. Nie można wykonać kodu w kontekście tylko odbicia. Aby uzyskać więcej informacji i na przykład kod, zobacz klasę CustomAttributeData .

Ta metoda pobiera dane atrybutów niestandardowych dla typów, typów zagnieżdżonych i składowych typów, ponieważ Type klasa i klasy w System.Reflection przestrzeni nazw reprezentujące wszystkie składowe typu pochodzą z MemberInfo.

Dotyczy