MethodBuilder.SetCustomAttribute Metódus

Definíció

Egyéni attribútumot állít be.

Túlterhelések

Name Description
SetCustomAttribute(CustomAttributeBuilder)

Egyéni attribútum beállítása egyéni attribútumszerkesztő használatával.

SetCustomAttribute(ConstructorInfo, Byte[])

Egyéni attribútum beállítása egy megadott egyéni attribútumblob használatával.

SetCustomAttribute(CustomAttributeBuilder)

Forrás:
MethodBuilder.cs
Forrás:
MethodBuilder.cs
Forrás:
MethodBuilder.cs
Forrás:
MethodBuilder.cs
Forrás:
MethodBuilder.cs

Egyéni attribútum beállítása egyéni attribútumszerkesztő használatával.

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éterek

customBuilder
CustomAttributeBuilder

Egy segédosztály egy példánya az egyéni attribútum leírásához.

Kivételek

customBuilder az null.

Az aktuális metódus esetében a IsGenericMethod tulajdonság az true, de a IsGenericMethodDefinition tulajdonság az false.

Megjegyzések

A SetCustomAttribute metódus akkor használhatja a SetImplementationFlags metódust, ha a két metódus együttes használata történik. A részletekért tekintse meg a módszer Megjegyzések szakaszát SetImplementationFlags .

A következőre érvényes:

SetCustomAttribute(ConstructorInfo, Byte[])

Forrás:
MethodBuilder.cs
Forrás:
MethodBuilder.cs
Forrás:
MethodBuilder.cs
Forrás:
MethodBuilder.cs
Forrás:
MethodBuilder.cs

Egyéni attribútum beállítása egy megadott egyéni attribútumblob használatával.

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éterek

con
ConstructorInfo

Az egyéni attribútum konstruktora.

binaryAttribute
Byte[]

Az attribútumokat képviselő bájtblob.

Attribútumok

Kivételek

con vagy binaryAttribute az null.

Az aktuális metódus esetében a IsGenericMethod tulajdonság az true, de a IsGenericMethodDefinition tulajdonság az false.

Megjegyzések

A formátumról binaryAttributea Common Language Infrastructure (CLI) specifikációjának II. partíciójában található metaadat-specifikációban talál további információt.

A SetCustomAttribute metódus akkor használhatja a SetImplementationFlags metódust, ha a két metódus együttes használata történik. A részletekért tekintse meg a módszer Megjegyzések szakaszát SetImplementationFlags .

A következőre érvényes: