Define handlers for .NET events in ABL
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
You must define any ABL class-based method or internal procedure that you want to subscribe as a handler for .NET events using a signature that is required by the .NET event. In .NET, this signature is defined by a delegate type that is associated with each event definition.
As a .NET convention, .NET event handler signatures have a void return type
and consist of two input parameters, both of which are object references. The first
parameter, identified as the sender, is always a reference
to a System.Object instance, which represents the object
that defines and publishes the event. The second parameter is typically a reference to
an event arguments class instance that is generated by .NET each time it publishes the
event. An event arguments class can be a System.EventArgs (the base class for all event arguments
classes) or any derived class.
The difference between one .NET delegate and another is the specific event arguments class specified for the event handler signature that it defines. Thus, .NET events that are defined with the same signature are typically defined with reference to the same delegate.