Bewerken

ModuleBuilder.SetCustomAttribute Method

Definition

Applies a custom attribute to this module.

Overloads

Name Description
SetCustomAttribute(ConstructorInfo, Byte[])

Applies a custom attribute to this module by using a specified binary large object (BLOB) that represents the attribute.

SetCustomAttribute(CustomAttributeBuilder)

Applies a custom attribute to this module by using a custom attribute builder.

SetCustomAttribute(ConstructorInfo, Byte[])

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

Applies a custom attribute to this module by using a specified binary large object (BLOB) that represents the attribute.

public:
 void SetCustomAttribute(System::Reflection::ConstructorInfo ^ con, cli::array <System::Byte> ^ binaryAttribute);
public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
member this.SetCustomAttribute : System.Reflection.ConstructorInfo * byte[] -> unit
Public Sub SetCustomAttribute (con As ConstructorInfo, binaryAttribute As Byte())

Parameters

con
ConstructorInfo

The constructor for the custom attribute.

binaryAttribute
Byte[]

A byte BLOB representing the attribute.

Exceptions

con or binaryAttribute is null.

Remarks

For more information about how to format binaryAttribute, see the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics". For more information, see ECMA 335 Common Language Infrastructure (CLI).

Applies to

SetCustomAttribute(CustomAttributeBuilder)

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

Applies a custom attribute to this module by using a custom attribute builder.

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)

Parameters

customBuilder
CustomAttributeBuilder

An instance of a helper class that specifies the custom attribute to apply.

Exceptions

customBuilder is null.

Applies to