VirtualTypeBuilder.EventInfoCollection.Add 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| Add(EventInfo) |
将 EventInfo 添加到集合的末尾。 |
| Add(String, Type) |
将 EventInfo 添加到集合的末尾。 |
| Add(String, Type, Attribute[]) |
将 EventInfo 添加到集合的末尾。 |
| Add(String, Type, Attribute[], MethodAttributes) |
将 EventInfo 添加到集合的末尾。 |
Add(EventInfo)
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
返回
已添加值处的索引。
例外
name 或 handlerType 中的元素 attributes 为 null 。 attributes 本身可能是 null 。
handlerType 不是运行时类型-或-不 methodAttributes 包含 Public 或包含除和以外的设置位 Public Static ,也不能将通过参数传入的特性 attributes 应用于事件。