ModuleBuilder.SetCustomAttribute Metod

Definition

Använder ett anpassat attribut för den här modulen.

Överlagringar

Name Description
SetCustomAttribute(CustomAttributeBuilder)

Använder ett anpassat attribut för den här modulen med hjälp av en anpassad attributbyggare.

SetCustomAttribute(ConstructorInfo, Byte[])

Använder ett anpassat attribut för den här modulen med hjälp av ett angivet binärt stort objekt (BLOB) som representerar attributet.

SetCustomAttribute(CustomAttributeBuilder)

Källa:
ModuleBuilder.cs
Källa:
ModuleBuilder.cs
Källa:
ModuleBuilder.cs
Källa:
ModuleBuilder.cs
Källa:
ModuleBuilder.cs

Använder ett anpassat attribut för den här modulen med hjälp av en anpassad attributbyggare.

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)

Parametrar

customBuilder
CustomAttributeBuilder

En instans av en hjälpklass som anger det anpassade attribut som ska tillämpas.

Undantag

customBuilder är null.

Gäller för

SetCustomAttribute(ConstructorInfo, Byte[])

Källa:
ModuleBuilder.cs
Källa:
ModuleBuilder.cs
Källa:
ModuleBuilder.cs
Källa:
ModuleBuilder.cs
Källa:
ModuleBuilder.cs

Använder ett anpassat attribut för den här modulen med hjälp av ett angivet binärt stort objekt (BLOB) som representerar attributet.

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

Parametrar

con
ConstructorInfo

Konstruktorn för det anpassade attributet.

binaryAttribute
Byte[]

En byteBLOB som representerar attributet.

Attribut

Undantag

con eller binaryAttribute är null.

Kommentarer

Mer information om hur du formaterar binaryAttributefinns i CLI-dokumentationen (Common Language Infrastructure), särskilt "Partition II: Metadata Definition and Semantics". Mer information finns i ECMA 335 Common Language Infrastructure (CLI).

Gäller för