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 );
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. |
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.
EventInfo Class | EventInfo Members | System.Reflection Namespace | Object | Delegate | EventHandler