TypeBuilder.SetCustomAttribute Метод

Определение

Задает настраиваемый атрибут.

Перегрузки

Имя Описание
SetCustomAttribute(CustomAttributeBuilder)

Задайте настраиваемый атрибут с помощью построителя настраиваемых атрибутов.

SetCustomAttribute(ConstructorInfo, Byte[])

Задает настраиваемый атрибут с помощью указанного пользовательского BLOB-объекта атрибута.

SetCustomAttribute(CustomAttributeBuilder)

Исходный код:
TypeBuilder.cs
Исходный код:
TypeBuilder.cs
Исходный код:
TypeBuilder.cs
Исходный код:
TypeBuilder.cs
Исходный код:
TypeBuilder.cs

Задайте настраиваемый атрибут с помощью построителя настраиваемых атрибутов.

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.

Для текущего динамического типа свойство равноIsGenericType, true но IsGenericTypeDefinition свойство равноfalse.

Применяется к

SetCustomAttribute(ConstructorInfo, Byte[])

Исходный код:
TypeBuilder.cs
Исходный код:
TypeBuilder.cs
Исходный код:
TypeBuilder.cs
Исходный код:
TypeBuilder.cs
Исходный код:
TypeBuilder.cs

Задает настраиваемый атрибут с помощью указанного пользовательского 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[]

Байтовый большой двоичный объект, представляющий атрибуты.

Атрибуты

Исключения

con или binaryAttribute есть null.

Для текущего динамического типа свойство равноIsGenericType, true но IsGenericTypeDefinition свойство равноfalse.

Комментарии

Дополнительные сведения о форматировании binaryAttributeсм. в разделе ECMA C# и стандартные стандарты инфраструктуры языка и стандарт ECMA-335 — инфраструктура общего языка (CLI).

Применяется к