Try OpenEdge Now
skip to main content
GUI for .NET Programming
Accessing and Managing .NET Classes from ABL : Handling .NET events
 

Handling .NET events

ABL supports several event models, including the use of triggers and call-backs for handle-based objects and the use of class events for class-based objects. .NET also supports an event model for classes. Like ABL class-based objects, .NET objects define events as members. Each object that defines an event is responsible for sending (publishing, in ABL terms) the event in response to some condition. Any other object can receive and respond to a given event using an event handler whose signature is defined as part of the event definition by a type of .NET class known as a delegate. The definitions for ABL class events typically define event signatures like an ABL method definition, but can also define event signatures with reference to a .NET delegate type. Again, like ABL class events, the events defined by .NET objects can be either instance or static events.
To respond to (handle) a .NET event in ABL, you must specify (subscribe) either an ABL method or an internal procedure as a handler for the event. (You cannot subscribe a .NET method as a handler for .NET events in ABL.)
Note: OpenEdge does not support the handling of .NET object events in non-GUI ABL sessions, such as a character-mode client or AppServer agent.
The .NET documentation for each event of an object specifies a delegate that defines the type of event handler that you must use to handle the event. Although ABL does allow (and sometimes requires) you to reference .NET delegates to define class event signatures, ABL does not refer directly to delegates to define event handlers, but instead provides its own syntax to do this, as described in this section. However, when you define a handler for a .NET event in ABL, you generally need to consult the .NET documentation for the delegate associated with a given event to identify the appropriate signature for the event handler that you define. This section also describes how to do this.
The following sections describe:
*Managing.NET events in ABL
*Identifying the events published by a .NET object
*Defining handlers for .NET events in ABL
*Specifying handler subscriptions for .NET events
*Managing .NET events from ABL-extended .NET classes
*Eventhandling example
* Managing .NET events in ABL
* Identifying the events published by a .NET object
* Defining handlers for .NET events in ABL
* Specifying handler subscriptions for .NET events
* Managing .NET events from ABL-extended .NET classes
* Event handling example