Bewerken

Share via


EventDescriptor.AddEventHandler(Object, Delegate) Method

Definition

When overridden in a derived class, binds the event to the component.

public:
 abstract void AddEventHandler(System::Object ^ component, Delegate ^ value);
public abstract void AddEventHandler (object component, Delegate value);
abstract member AddEventHandler : obj * Delegate -> unit
Public MustOverride Sub AddEventHandler (component As Object, value As Delegate)

Parameters

component
Object

A component that provides events to the delegate.

value
Delegate

A delegate that represents the method that handles the event.

Remarks

Typically, this method is implemented through reflection. For more information about reflection, see the topics in Reflection.

For more information about delegates, see Handling and Raising Events.

Notes to Implementers

When you override this method, it should add the delegate to the component's event list by invoking the appropriate add_myHandler method.

Applies to

See also