Partager via


VirtualTypeBuilder.EventInfoCollection.Add Method

Definition

Overloads

Add(EventInfo)

Adds an EventInfo to the end of the collection.

Add(String, Type)

Adds an EventInfo to the end of the collection.

Add(String, Type, Attribute[])

Adds an EventInfo to the end of the collection.

Add(String, Type, Attribute[], MethodAttributes)

Adds an EventInfo to the end of the collection.

Add(EventInfo)

Adds an EventInfo to the end of the collection.

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

Parameters

value
EventInfo

The EventInfo to be added to the end of the collection.

Returns

The index at which the value has been added.

Applies to

Add(String, Type)

Adds an EventInfo to the end of the collection.

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

Parameters

name
String

The name of the event to add.

handlerType
Type

The type of delegate this event represents.

Returns

The index at which the value has been added.

Exceptions

name or handlerType is null.

handlerType is not a run-time type.

Applies to

Add(String, Type, Attribute[])

Adds an EventInfo to the end of the collection.

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

Parameters

name
String

The name of the event to add.

handlerType
Type

The type of delegate this event represents.

attributes
Attribute[]

This value must be Public and/or Static.

Returns

The index at which the value has been added.

Exceptions

name or handlerType or an element in attributes is null. attributes itself may be null.

handlerType is not a run-time type.

Applies to

Add(String, Type, Attribute[], MethodAttributes)

Adds an EventInfo to the end of the collection.

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

Parameters

name
String

The name of the event to add.

handlerType
Type

The type of delegate this event represents.

attributes
Attribute[]

An array of Attribute objects.

methodAttributes
MethodAttributes

The only method attributes currently supported are Public and/or Static.

Returns

The index at which the value has been added.

Exceptions

name or handlerType or an element in attributes is null. attributes itself may be null.

handlerType is not a run-time type-or- methodAttributes does not contain Public or contains set bits other than Public and Static, or attributes passed in through the attributes parameter cannot be applied to events.

Applies to