TypeBuilder.SetCustomAttribute Metode

Definisi

Mengatur atribut kustom.

Overload

Nama Deskripsi
SetCustomAttribute(CustomAttributeBuilder)

Atur atribut kustom menggunakan pembangun atribut kustom.

SetCustomAttribute(ConstructorInfo, Byte[])

Mengatur atribut kustom menggunakan blob atribut kustom tertentu.

SetCustomAttribute(CustomAttributeBuilder)

Sumber:
TypeBuilder.cs
Sumber:
TypeBuilder.cs
Sumber:
TypeBuilder.cs
Sumber:
TypeBuilder.cs
Sumber:
TypeBuilder.cs

Atur atribut kustom menggunakan pembangun atribut kustom.

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)

Parameter

customBuilder
CustomAttributeBuilder

Instans kelas pembantu untuk menentukan atribut kustom.

Pengecualian

customBuilder adalah null.

Untuk jenis dinamis saat ini, IsGenericType propertinya adalah true, tetapi IsGenericTypeDefinition propertinya adalah false.

Berlaku untuk

SetCustomAttribute(ConstructorInfo, Byte[])

Sumber:
TypeBuilder.cs
Sumber:
TypeBuilder.cs
Sumber:
TypeBuilder.cs
Sumber:
TypeBuilder.cs
Sumber:
TypeBuilder.cs

Mengatur atribut kustom menggunakan blob atribut kustom tertentu.

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

Parameter

con
ConstructorInfo

Konstruktor untuk atribut kustom.

binaryAttribute
Byte[]

Blob byte yang mewakili atribut.

Atribut

Pengecualian

con atau binaryAttribute adalah null.

Untuk jenis dinamis saat ini, IsGenericType propertinya adalah true, tetapi IsGenericTypeDefinition propertinya adalah false.

Keterangan

Untuk informasi selengkapnya tentang cara memformat binaryAttribute, lihat ECMA C# dan Standar Infrastruktur Bahasa Umum dan ECMA-335 Standar - Infrastruktur Bahasa Umum (CLI).

Berlaku untuk