This documentation is archived and is not being maintained.

VirtualTypeImplementor.AddEventHandler Method

Adds the given delegate to the given event.

Namespace: Microsoft.VisualStudio.Shell.Design
Assembly: Microsoft.VisualStudio.Shell.Design (in microsoft.visualstudio.shell.design.dll)

public virtual void AddEventHandler (
	EventInfo eventInfo,
	Object instance,
	Delegate handler
)
public void AddEventHandler (
	EventInfo eventInfo, 
	Object instance, 
	Delegate handler
)
public function AddEventHandler (
	eventInfo : EventInfo, 
	instance : Object, 
	handler : Delegate
)

Parameters

eventInfo

The event to add the handler to.

instance

The instance on which to add the event handler. This may be a null reference (Nothing in Visual Basic) if the event is static.

handler

The event handler to add.

Exception typeCondition

NotImplementedException

If non-abstract derived class did not provide an implementation by overriding this method.

This method attempts to add a delegate to synchronize the event on the target object. Each time the event is raised by the instance parameter, the method or methods encapsulated by the handler will be invoked.

Show: