ConstructorBuilder.GetCustomAttributes Metoda

Definicja

Zwraca atrybuty niestandardowe zdefiniowane dla tego konstruktora.

Przeciążenia

GetCustomAttributes(Boolean)

Zwraca wszystkie atrybuty niestandardowe zdefiniowane dla tego konstruktora.

GetCustomAttributes(Type, Boolean)

Zwraca atrybuty niestandardowe identyfikowane przez dany typ.

GetCustomAttributes(Boolean)

Źródło:
ConstructorBuilder.cs

Zwraca wszystkie atrybuty niestandardowe zdefiniowane dla tego konstruktora.

public:
 override cli::array <System::Object ^> ^ GetCustomAttributes(bool inherit);
public override object[] GetCustomAttributes (bool inherit);
override this.GetCustomAttributes : bool -> obj[]
Public Overrides Function GetCustomAttributes (inherit As Boolean) As Object()

Parametry

inherit
Boolean

Steruje dziedziczeniem atrybutów niestandardowych z klas bazowych. Ten parametr jest ignorowany.

Zwraca

Object[]

Tablica obiektów reprezentujących wszystkie atrybuty niestandardowe konstruktora reprezentowanego przez to ConstructorBuilder wystąpienie.

Wyjątki

Ta metoda nie jest obecnie obsługiwana.

Uwagi

Parametr inherit jest ignorowany, ponieważ klasa nigdy nie dziedziczy konstruktorów z klas bazowych.

Aby uzyskać atrybuty niestandardowe, zakończ kompilowanie typu przez wywołanie CreateTypemetody , pobierz konstruktor, wywołując GetConstructor metodę dla zwracanego typu, a następnie wywołaj GetCustomAttributes metodę dla zwróconego ConstructorInfoelementu .

Dotyczy

GetCustomAttributes(Type, Boolean)

Źródło:
ConstructorBuilder.cs

Zwraca atrybuty niestandardowe identyfikowane przez dany typ.

public:
 override cli::array <System::Object ^> ^ GetCustomAttributes(Type ^ attributeType, bool inherit);
public override object[] GetCustomAttributes (Type attributeType, bool inherit);
override this.GetCustomAttributes : Type * bool -> obj[]
Public Overrides Function GetCustomAttributes (attributeType As Type, inherit As Boolean) As Object()

Parametry

attributeType
Type

Typ atrybutu niestandardowego.

inherit
Boolean

Steruje dziedziczeniem atrybutów niestandardowych z klas bazowych. Ten parametr jest ignorowany.

Zwraca

Object[]

Tablica obiektów reprezentująca atrybuty tego konstruktora.

Wyjątki

Ta metoda nie jest obecnie obsługiwana.

Uwagi

Parametr inherit jest ignorowany, ponieważ klasa nigdy nie dziedziczy konstruktorów z klas bazowych.

Aby uzyskać atrybuty niestandardowe, zakończ kompilowanie typu przez wywołanie CreateTypemetody , pobierz konstruktor, wywołując GetConstructor metodę dla zwracanego typu, a następnie wywołaj GetCustomAttributes metodę dla zwróconego ConstructorInfoelementu .

Dotyczy