TypeBuilder.SetCustomAttribute Metodo

Definizione

Imposta un attributo personalizzato.

Overload

Nome Descrizione
SetCustomAttribute(CustomAttributeBuilder)

Impostare un attributo personalizzato usando un generatore di attributi personalizzato.

SetCustomAttribute(ConstructorInfo, Byte[])

Imposta un attributo personalizzato usando un BLOB di attributi personalizzato specificato.

SetCustomAttribute(CustomAttributeBuilder)

Impostare un attributo personalizzato usando un generatore di attributi personalizzato.

public:
 void SetCustomAttribute(System::Reflection::Emit::CustomAttributeBuilder ^ customBuilder);
public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
member this.SetCustomAttribute : System.Reflection.Emit.CustomAttributeBuilder -> unit
Public Sub SetCustomAttribute (customBuilder As CustomAttributeBuilder)

Parametri

customBuilder
CustomAttributeBuilder

Istanza di una classe helper per definire l'attributo personalizzato.

Eccezioni

customBuilder è null.

Per il tipo dinamico corrente, la IsGenericType proprietà è true, ma la IsGenericTypeDefinition proprietà è false.

Si applica a

SetCustomAttribute(ConstructorInfo, Byte[])

Imposta un attributo personalizzato usando un BLOB di attributi personalizzato specificato.

public:
 void SetCustomAttribute(System::Reflection::ConstructorInfo ^ con, cli::array <System::Byte> ^ binaryAttribute);
public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
[System.Runtime.InteropServices.ComVisible(true)]
public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
member this.SetCustomAttribute : System.Reflection.ConstructorInfo * byte[] -> unit
[<System.Runtime.InteropServices.ComVisible(true)>]
member this.SetCustomAttribute : System.Reflection.ConstructorInfo * byte[] -> unit
Public Sub SetCustomAttribute (con As ConstructorInfo, binaryAttribute As Byte())

Parametri

con
ConstructorInfo

Costruttore per l'attributo personalizzato.

binaryAttribute
Byte[]

BLOB di byte che rappresenta gli attributi.

Attributi

Eccezioni

con o binaryAttribute è null.

Per il tipo dinamico corrente, la IsGenericType proprietà è true, ma la IsGenericTypeDefinition proprietà è false.

Commenti

Per altre informazioni su come formattare , vedere ECMA C# e Common Language Infrastructure Standards eStandard ECMA-335 - Common Language Infrastructure (CLI).For more information on how to format binaryAttribute, see ECMA C# and Common Language Infrastructure Standards and Standard ECMA-335 - Common Language Infrastructure (CLI).

Si applica a