Mercury.QTP.CustomServer Namespace > CustomServerBase Class > AddHandler Method : AddHandler(String,Delegate,Type) Method |
AddHandler
is called first.This method adds an Event handler with custom serialization support. If the source control serializes the arguments, use CustomServerBase.AddHandler(string EventName, Delegate oHandler)
To add an Event handler where the event arguments are not serialized by the source control, implement an IEventArgsHelper class to serialize the event arguments and pass its type to this method.
Handlers added with this method are released by the UFT infrastructure.
Call this method from a custom server running in the UFT context.
For an example, see IEventArgsHelper
'Declaration
Protected Overloads Sub AddHandler( _ ByVal EventName As System.String, _ ByVal e As System.Delegate, _ ByVal SerializedArgsType As System.Type _ )
protected void AddHandler( System.string EventName, System.Delegate e, System.Type SerializedArgsType )
Parameters
- EventName
- The control's event name (for example "Click").
- e
- The Event handler.
- SerializedArgsType
- The user defined type used to serialize the Event arguments.