ModuleBuilder.SetCustomAttribute 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
為此模組套用自訂屬性。
多載
| 名稱 | Description |
|---|---|
| SetCustomAttribute(CustomAttributeBuilder) |
透過使用自訂屬性建構器,套用自訂屬性給這個模組。 |
| SetCustomAttribute(ConstructorInfo, Byte[]) |
透過指定的二進位大型物件(BLOB)來代表該屬性,為此模組套用自訂屬性。 |
SetCustomAttribute(CustomAttributeBuilder)
透過使用自訂屬性建構器,套用自訂屬性給這個模組。
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。
適用於
SetCustomAttribute(ConstructorInfo, Byte[])
透過指定的二進位大型物件(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。
備註
欲了解更多格式化資訊 binaryAttribute,請參閱通用語言基礎架構(CLI)文件,特別是「分割區 II:元資料定義與語意」。 欲了解更多資訊,請參閱 ECMA 335 通用語言基礎架構(CLI)。