PropertyBuilder.SetCustomAttribute 方法    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
设置自定义属性。
重载
| SetCustomAttribute(CustomAttributeBuilder) | 
						 使用自定义属性生成器设置自定义属性。  | 
        	
| SetCustomAttribute(ConstructorInfo, Byte[]) | 
						 使用指定的自定义属性 blob 设置自定义属性。  | 
        	
SetCustomAttribute(CustomAttributeBuilder)
- Source:
 - PropertyBuilder.cs
 
- Source:
 - PropertyBuilder.cs
 
- Source:
 - PropertyBuilder.cs
 
- Source:
 - PropertyBuilder.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
 
用于定义自定义属性的帮助程序类的一个实例。
例外
              customBuilder 为 null。
如果已对封闭类型调用了 CreateType()。
适用于
SetCustomAttribute(ConstructorInfo, Byte[])
- Source:
 - PropertyBuilder.cs
 
- Source:
 - PropertyBuilder.cs
 
- Source:
 - PropertyBuilder.cs
 
- Source:
 - PropertyBuilder.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。
- 属性
 
例外
              con 或 binaryAttribute 为 null。
已对封闭类型调用了 CreateType()。
注解
有关如何格式化 binaryAttribute的信息,请参阅 ECMA-335 公共语言基础结构 (CLI) 分区 II 中的元数据规范。