TypeBuilder.SetCustomAttribute Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Définit un attribut personnalisé.
Surcharges
| Nom | Description |
|---|---|
| SetCustomAttribute(CustomAttributeBuilder) |
Définissez un attribut personnalisé à l’aide d’un générateur d’attributs personnalisé. |
| SetCustomAttribute(ConstructorInfo, Byte[]) |
Définit un attribut personnalisé à l’aide d’un objet blob d’attributs personnalisé spécifié. |
SetCustomAttribute(CustomAttributeBuilder)
Définissez un attribut personnalisé à l’aide d’un générateur d’attributs personnalisé.
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)
Paramètres
- customBuilder
- CustomAttributeBuilder
Instance d’une classe d’assistance pour définir l’attribut personnalisé.
Exceptions
customBuilder a la valeur null.
Pour le type dynamique actuel, la IsGenericType propriété est true, mais la IsGenericTypeDefinition propriété est false.
S’applique à
SetCustomAttribute(ConstructorInfo, Byte[])
Définit un attribut personnalisé à l’aide d’un objet blob d’attributs personnalisé spécifié.
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())
Paramètres
- con
- ConstructorInfo
Constructeur de l’attribut personnalisé.
- binaryAttribute
- Byte[]
Objet blob d’octets représentant les attributs.
- Attributs
Exceptions
con ou binaryAttribute est null.
Pour le type dynamique actuel, la IsGenericType propriété est true, mais la IsGenericTypeDefinition propriété est false.
Remarques
Pour plus d’informations sur la mise en forme binaryAttribute, consultez les normes ECMA C# et Common Language Infrastructure Standard et ECMA-335 - Common Language Infrastructure (CLI).