Open topic with navigation
Called once by the UFT infrastructure during initialization of the object.
To hook a control's events, override this method and register your event handlers in one of these ways, or a combination of them:
If the Custom Server runs in the AUT context, define and add Event handlers with CustomServerBase.AddHandler.
Delegate e = new System.EventHandler(this.ValueChanged); AddHandler("ValueChanged", e);There is no limit to the number of handlers defined this way.
If the Custom Server runs in the AUT context you can write:
SourceControl.ValueChanged += e; If you use this syntax, override CustomServerBase.ReleaseEventListener to unsubscribe from Event handling.
We recommend using
AddHandler rather than the '+=' syntax. If you use
AddHandler, your handler is guaranteed to be the first handler in the handlers list. This mean your handler gets the Events before other handlers. In addition, if you use
AddHandler UFT automatically removes your handler at the end of the Record session.