NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

EventInfo.AddEventHandler

Adds an event handler to an event source.

Implementation of this member is not complete for this release of the NGWS SDK. This documentation is for information only.

[Visual Basic]
Public Sub AddEventHandler( _
   ByVal target As Object, _
   ByVal handler As Delegate _
)
[C#]
public void AddEventHandler(
   object target,
   Delegate handler
);
[C++]
public: void AddEventHandler(
   Object* target,
   Delegate* handler
);
[JScript]
public function AddEventHandler(
   target : Object,
   handler : Delegate
);

Parameters

target
The event source.
handler
Encapsulates a method, or multiple methods, to be invoked when the event is raised by the target.

Exceptions

Exception Type Condition
ArgumentException target or handler is a null reference (in Visual Basic Nothing).
AccessException The caller does not have permission to invoke the "add" method on the event source (e.g. It may be private.)
TargetInvocationException The "add" method throws an exception.
ArgumentException handler is not the same type as the event handler delegate used in conjunction with the event reflected by this instance.

Remarks

The AddEventHandler method will atttempt to add a delegate to sync the event on the the target object.Each time the event is raised by the target parameter, the method or methods encapsulated by the handler will be invoked.

See Also

EventInfo Class | EventInfo Members | System.Reflection Namespace | Object | Delegate | EventHandler