VirtualTypeImplementor::AddEventHandler Method (EventInfo^, Object^, Delegate^)

 

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
)

Parameters

eventInfo
Type: System.Reflection::EventInfo^

The event to add the handler to.

instance
Type: System::Object^

The instance on which to add the event handler. This may be null if the event is static.

handler
Type: System::Delegate^

The event handler to add.

Exception Condition
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.

Return to top
Show: