MethodBuilder.SetCustomAttribute Metodo

Definizione

Imposta un attributo personalizzato.

Overload

SetCustomAttribute(CustomAttributeBuilder)

Imposta un attributo personalizzato usando un generatore di attributi personalizzati.

SetCustomAttribute(ConstructorInfo, Byte[])

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

SetCustomAttribute(CustomAttributeBuilder)

Source:
MethodBuilder.cs
Source:
MethodBuilder.cs
Source:
MethodBuilder.cs

Imposta un attributo personalizzato usando un generatore di attributi personalizzati.

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

Un'istanza di una classe helper per descrivere l'attributo personalizzato.

Eccezioni

customBuilder è null.

Per il metodo corrente la proprietà IsGenericMethod è true, ma la proprietà IsGenericMethodDefinition è false.

Commenti

Il SetCustomAttribute metodo può interagire con il SetImplementationFlags metodo quando i due metodi vengono usati in combinazione. Per informazioni dettagliate, vedere la sezione Osservazioni del SetImplementationFlags metodo.

Si applica a

SetCustomAttribute(ConstructorInfo, Byte[])

Source:
MethodBuilder.cs
Source:
MethodBuilder.cs
Source:
MethodBuilder.cs

Imposta un attributo personalizzato usando un BLOB di attributi personalizzati 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 dell'attributo personalizzato.

binaryAttribute
Byte[]

BLOB di byte che rappresenta gli attributi.

Attributi

Eccezioni

con o binaryAttribute è null.

Per il metodo corrente la proprietà IsGenericMethod è true, ma la proprietà IsGenericMethodDefinition è false.

Commenti

Per informazioni su come formattare binaryAttribute, vedere la specifica dei metadati in Partition II della specifica Common Language Infrastructure (CLI).

Il SetCustomAttribute metodo può interagire con il SetImplementationFlags metodo quando i due metodi vengono usati in combinazione. Per informazioni dettagliate, vedere la sezione Osservazioni del SetImplementationFlags metodo.

Si applica a