VirtualTypeBuilder.EventInfoCollection.Add Метод
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Перегрузки
| Add(EventInfo) |
Добавляет объект EventInfo в конец коллекции. |
| Add(String, Type) |
Добавляет объект EventInfo в конец коллекции. |
| Add(String, Type, Attribute[]) |
Добавляет объект EventInfo в конец коллекции. |
| Add(String, Type, Attribute[], MethodAttributes) |
Добавляет объект EventInfo в конец коллекции. |
Add(EventInfo)
Добавляет объект EventInfo в конец коллекции.
public:
int Add(System::Reflection::EventInfo ^ value);
public int Add (System.Reflection.EventInfo value);
member this.Add : System.Reflection.EventInfo -> int
Public Function Add (value As EventInfo) As Integer
Параметры
Возвращаемое значение
Индекс, по которому добавлено значение.
Применяется к
Add(String, Type)
Добавляет объект EventInfo в конец коллекции.
public:
int Add(System::String ^ name, Type ^ handlerType);
public:
int Add(Platform::String ^ name, Platform::Type ^ handlerType);
public int Add (string name, Type handlerType);
member this.Add : string * Type -> int
Public Function Add (name As String, handlerType As Type) As Integer
Параметры
- name
- String
Имя добавляемого события.
- handlerType
- Type
Тип делегата, который представляет это событие.
Возвращаемое значение
Индекс, по которому добавлено значение.
Исключения
Параметр name или handlerType имеет значение null.
Параметр handlerType не является типом времени выполнения.
Применяется к
Add(String, Type, Attribute[])
Добавляет объект EventInfo в конец коллекции.
public:
int Add(System::String ^ name, Type ^ handlerType, cli::array <Attribute ^> ^ attributes);
public:
int Add(Platform::String ^ name, Platform::Type ^ handlerType, Platform::Array <Platform::Metadata::Attribute ^> ^ attributes);
public int Add (string name, Type handlerType, Attribute[] attributes);
member this.Add : string * Type * Attribute[] -> int
Public Function Add (name As String, handlerType As Type, attributes As Attribute()) As Integer
Параметры
- name
- String
Имя добавляемого события.
- handlerType
- Type
Тип делегата, который представляет это событие.
Возвращаемое значение
Индекс, по которому добавлено значение.
Исключения
name либо handlerType, либо элемент в attributes равен null. Параметр attributes сам может иметь значение null.
Параметр handlerType не является типом времени выполнения.
Применяется к
Add(String, Type, Attribute[], MethodAttributes)
Добавляет объект EventInfo в конец коллекции.
public:
int Add(System::String ^ name, Type ^ handlerType, cli::array <Attribute ^> ^ attributes, System::Reflection::MethodAttributes methodAttributes);
public int Add (string name, Type handlerType, Attribute[] attributes, System.Reflection.MethodAttributes methodAttributes);
member this.Add : string * Type * Attribute[] * System.Reflection.MethodAttributes -> int
Public Function Add (name As String, handlerType As Type, attributes As Attribute(), methodAttributes As MethodAttributes) As Integer
Параметры
- name
- String
Имя добавляемого события.
- handlerType
- Type
Тип делегата, который представляет это событие.
- methodAttributes
- MethodAttributes
В настоящее время поддерживаются только атрибуты метода Public и/или Static.
Возвращаемое значение
Индекс, по которому добавлено значение.
Исключения
name либо handlerType, либо элемент в attributes равен null. Параметр attributes сам может иметь значение null.
handlerType не является типом времени выполнения или не содержит methodAttributes Public или содержит набор битов, отличный от Public и Static , либо атрибуты, передаваемые через attributes параметр, не могут применяться к событиям.