TypeBuilder.SetCustomAttribute Metoda

Definice

Nastaví vlastní atribut.

Přetížení

Name Description
SetCustomAttribute(CustomAttributeBuilder)

Nastavte vlastní atribut pomocí tvůrce vlastních atributů.

SetCustomAttribute(ConstructorInfo, Byte[])

Nastaví vlastní atribut pomocí zadaného objektu blob vlastního atributu.

SetCustomAttribute(CustomAttributeBuilder)

Zdroj:
TypeBuilder.cs
Zdroj:
TypeBuilder.cs
Zdroj:
TypeBuilder.cs
Zdroj:
TypeBuilder.cs
Zdroj:
TypeBuilder.cs

Nastavte vlastní atribut pomocí tvůrce vlastních 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 definující vlastní atribut.

Výjimky

customBuilder je null.

U aktuálního dynamického typu IsGenericType je truevlastnost , ale vlastnost IsGenericTypeDefinition je false.

Platí pro

SetCustomAttribute(ConstructorInfo, Byte[])

Zdroj:
TypeBuilder.cs
Zdroj:
TypeBuilder.cs
Zdroj:
TypeBuilder.cs
Zdroj:
TypeBuilder.cs
Zdroj:
TypeBuilder.cs

Nastaví vlastní atribut pomocí zadaného objektu blob vlastního atributu.

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[]

Bajtový objekt blob představující atributy.

Atributy

Výjimky

con nebo binaryAttribute je null.

U aktuálního dynamického typu IsGenericType je truevlastnost , ale vlastnost IsGenericTypeDefinition je false.

Poznámky

Další informace o formátování binaryAttributenajdete v tématu ECMA C# a Common Language Infrastructure Standards a Standard ECMA-335 - Common Language Infrastructure (CLI).

Platí pro