ParameterBuilder.SetCustomAttribute 方法

定义

设置自定义属性。

重载

SetCustomAttribute(CustomAttributeBuilder)

使用自定义属性生成器设置自定义属性。

SetCustomAttribute(ConstructorInfo, Byte[])

使用指定的自定义属性 blob 设置自定义属性。

SetCustomAttribute(CustomAttributeBuilder)

Source:
ParameterBuilder.cs
Source:
ParameterBuilder.cs
Source:
ParameterBuilder.cs

使用自定义属性生成器设置自定义属性。

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)

参数

customBuilder
CustomAttributeBuilder

用于定义自定义属性的帮助程序类的一个实例。

例外

connull

适用于

SetCustomAttribute(ConstructorInfo, Byte[])

Source:
ParameterBuilder.cs
Source:
ParameterBuilder.cs
Source:
ParameterBuilder.cs

使用指定的自定义属性 blob 设置自定义属性。

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

参数

con
ConstructorInfo

自定义属性的构造函数。

binaryAttribute
Byte[]

表示属性的字节 blob。

属性

例外

conbinaryAttributenull

注解

有关如何设置 格式 binaryAttribute的信息,请参阅 公共语言基础结构的分区 II 中的元数据规范 (CLI) 规范

适用于