Try OpenEdge Now
skip to main content
GUI for .NET Programming
Accessing and Managing .NET Classes from ABL : Defining ABL-extended .NET objects : Managing events for ABL-derived .NET classes : Publishing inherited .NET events
 
Publishing inherited .NET events
You can programmatically publish an event that an ABL-derived class inherits from a .NET object by calling an inherited method that the .NET base class defines to publish the event. Such inherited .NET methods for publishing events are typically defined as protected and, by convention, have the following general method calling sequence:

Syntax

OnEventName( [EventArgs] )
Element descriptions for this syntax diagram follow:
EventName
Specifies the .NET name of the event.
eArgs
Passes an INPUT object reference argument defined as a System.EventArgs (or a derived class, depending on the method). This is the System.EventArgs argument that is passed as the second parameter to any handler method for this event (see Defining handlers for .NET events in ABL).
So, for example, the .NET method to publish the FormClosing event on a Progress.Windows.Form is the OnFormClosing( ) method.
An ABL-derived class that inherits from a .NET class might need to both publish an inherited event and perform another action at the same time. For example, you might define an ABL BlueButton class that inherits from .NET's System.Windows.Forms.Button. For many events, such as the Click event, the .NET super class defines the method to fire the event as virtual (or override). You can thus override this event method like any other virtual method to provide additional event behavior.
However, if you override a method that .NET defines to publish an event, you must always invoke SUPER:OnEventName( ) to publish the event on the base class to ensure that all subscribers receive the event. You can code your custom behavior before or after this SUPER method call, as necessary.