PropertyBuilder.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éfinissez 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.
si CreateType() elle a été appelée sur le type englobant.
S’applique à
SetCustomAttribute(ConstructorInfo, Byte[])
Définissez 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.
CreateType() a été appelé sur le type englobant.
Remarques
Pour plus d’informations sur la mise en forme binaryAttribute, consultez la spécification des métadonnées dans la partition II de l’interface CLI (Common Language Infrastructure) ECMA-335.