ModuleBuilder.SetCustomAttribute Metodo

Definizione

Applica un attributo personalizzato al modulo.

Overload

SetCustomAttribute(CustomAttributeBuilder)

Applica un attributo personalizzato al modulo utilizzando un generatore di attributi personalizzati.

SetCustomAttribute(ConstructorInfo, Byte[])

Applica un attributo personalizzato al modulo tramite un oggetto binario di grandi dimensioni (BLOB) specificato che rappresenta l'attributo.

SetCustomAttribute(CustomAttributeBuilder)

Source:
ModuleBuilder.cs
Source:
ModuleBuilder.cs
Source:
ModuleBuilder.cs

Applica un attributo personalizzato al modulo utilizzando 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

Istanza di una classe di supporto che consente di specificare l'attributo personalizzato da applicare.

Eccezioni

customBuilder è null.

Commenti

Nota

A partire da .NET Framework 2.0 Service Pack 1, questo membro non richiede ReflectionPermission più con il ReflectionPermissionFlag.ReflectionEmit flag. Vedere Problemi di sicurezza in Reflection Emit. Per usare questa funzionalità, l'applicazione deve essere destinato a .NET Framework 3.5 o versione successiva.

Si applica a

SetCustomAttribute(ConstructorInfo, Byte[])

Source:
ModuleBuilder.cs
Source:
ModuleBuilder.cs
Source:
ModuleBuilder.cs

Applica un attributo personalizzato al modulo tramite un oggetto binario di grandi dimensioni (BLOB) specificato che rappresenta l'attributo.

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 l'attributo.

Attributi

Eccezioni

con o binaryAttribute è null.

Commenti

Per altre informazioni su come formattare binaryAttribute, vedere la documentazione di Common Language Infrastructure (CLI), in particolare "Partition II: Metadata Definition and Semantics". Per altre informazioni, vedere ECMA 335 Common Language Infrastructure (CLI).

Nota

A partire da .NET Framework 2.0 Service Pack 1, questo membro non richiede ReflectionPermission più con il ReflectionPermissionFlag.ReflectionEmit flag. Vedere Problemi di sicurezza in Reflection Emit. Per usare questa funzionalità, l'applicazione deve essere destinato a .NET Framework 3.5 o versione successiva.

Si applica a