GenericTypeParameterBuilder.SetCustomAttribute Méthode
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é.
SetCustomAttribute(CustomAttributeBuilder) |
Définit un attribut personnalisé à l’aide d’un générateur d’attributs personnalisés. |
SetCustomAttribute(ConstructorInfo, Byte[]) |
Définit un attribut personnalisé à l’aide d’un objet blob d’attribut personnalisé spécifié. |
Définit un attribut personnalisé à l’aide d’un générateur d’attributs personnalisés.
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 qui définit l’attribut personnalisé.
Exceptions
customBuilder
a la valeur null
.
S’applique à
.NET 10 et autres versions
Produit | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 |
Définit un attribut personnalisé à l’aide d’un objet blob d’attribut personnalisé spécifié.
public:
void SetCustomAttribute(System::Reflection::ConstructorInfo ^ con, cli::array <System::Byte> ^ binaryAttribute);
public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
member this.SetCustomAttribute : System.Reflection.ConstructorInfo * byte[] -> unit
Public Sub SetCustomAttribute (con As ConstructorInfo, binaryAttribute As Byte())
Paramètres
- con
- ConstructorInfo
Le constructeur de l’attribut personnalisé.
- binaryAttribute
- Byte[]
Objet blob d’octets représentant l’attribut.
Exceptions
Remarques
Pour plus d’informations sur la mise en formebinaryAttribute
, consultez la spécification des métadonnées dans Partition II de la spécification CLI (Common Language Infrastructure).
S’applique à
.NET 10 et autres versions
Produit | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 |
Commentaires sur .NET
.NET est un projet open source. Sélectionnez un lien pour fournir des commentaires :