ModuleBuilder.SetCustomAttribute Metoda

Definice

Použije na tento modul vlastní atribut.

Přetížení

SetCustomAttribute(CustomAttributeBuilder)

Použije vlastní atribut na tento modul pomocí vlastního tvůrce atributů.

SetCustomAttribute(ConstructorInfo, Byte[])

Použije vlastní atribut na tento modul pomocí zadaného binárního velkého objektu (BLOB), který představuje atribut .

SetCustomAttribute(CustomAttributeBuilder)

Zdroj:
ModuleBuilder.cs
Zdroj:
ModuleBuilder.cs
Zdroj:
ModuleBuilder.cs

Použije vlastní atribut na tento modul pomocí vlastního tvůrce atributů.

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)

Parametry

customBuilder
CustomAttributeBuilder

Instance pomocné třídy, která určuje vlastní atribut použít.

Výjimky

customBuilder je null.

Poznámky

Poznámka

Počínaje .NET Framework 2.0 Service Pack 1, tento člen již nevyžaduje ReflectionPermission s příznakem ReflectionPermissionFlag.ReflectionEmit . (Viz Problémy se zabezpečením v reflexi Emit.) Pokud chcete tuto funkci používat, měla by vaše aplikace cílit na rozhraní .NET Framework 3.5 nebo novější.

Platí pro

SetCustomAttribute(ConstructorInfo, Byte[])

Zdroj:
ModuleBuilder.cs
Zdroj:
ModuleBuilder.cs
Zdroj:
ModuleBuilder.cs

Použije vlastní atribut na tento modul pomocí zadaného binárního velkého objektu (BLOB), který představuje atribut .

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())

Parametry

con
ConstructorInfo

Konstruktor pro vlastní atribut.

binaryAttribute
Byte[]

Bajt blob představující atribut.

Atributy

Výjimky

con nebo binaryAttribute je null.

Poznámky

Další informace o formátování binaryAttributenajdete v dokumentaci k common language infrastructure (CLI), zejména v části Oddíl II: Definice metadat a sémantika. Další informace najdete v tématu ECMA 335 Common Language Infrastructure (CLI).

Poznámka

Počínaje .NET Framework 2.0 Service Pack 1, tento člen již nevyžaduje ReflectionPermission s příznakem ReflectionPermissionFlag.ReflectionEmit . (Viz Problémy se zabezpečením v reflexi Emit.) Pokud chcete tuto funkci používat, měla by vaše aplikace cílit na rozhraní .NET Framework 3.5 nebo novější.

Platí pro