In order to support invoking PowerScript events in C#, the PowerBuilder DotNetObject object has been added with the following two new functions:
-
RegisterObject -- Registers the PowerBuilder object. After registration, the event in the PowerBuilder object can be triggered by .NET assembly. The event to be triggered by .NET assembly is a custom event that can only have one string-type parameter or no parameter, with one string-type return value or no return value.
-
UnregisterObject -- Unregisters the PowerBuilder object.
The PowerScript user event can be triggered by the C# script through the following .NET method:
-
PowerBuilder.RegisteredObject.TriggerEvent -- Triggers the user event in the registered PowerBuilder object. The user event can only have one string-type parameter or no parameter, with one string-type return value or no return value.
You can pass a generic type, delegate, interface, or non-array class (including abstract) as parameter or return value in a function loaded from .NET assembly. (.NET DLL Importer also has these enhancements. For more, refer to this section in Application Techniques.)
The PowerBuilder DotNetAssembly object has been added with the following new function:
-
LoadWithDotNet -- Loads a .NET (5 or later) assembly.