The LoadAsync method is an asynchronous call that loads a specified ispec or class in the runtime system for a session. The calling process is not blocked during the execution of the method. A specified callback method receives a new TransmissionObject when the call completes.
Namespace – ABSuite.AccessLayer.Connector.Core
Assembly – Unisys.ABSuite.AccessLayer.Connector.Core (in Unisys.ABSuite.AccessLayer.Connector.Core.dll)
Syntax
Task<TransmissionObject> LoadAsync( string name, bool withSwitch = true )
Arguments
name – System.String
This argument provides the name of the ispec or class to be loaded.
withSwitch – System.Boolean
This argument is optional. It determines whether a TransmissionObjectChanged event is raised. By default, this is set to true.
Return Value
If this method succeeds, a TransmissionObject can be retrieved containing the specified DataModel that was loaded.
Using the IConnection Interface for the LoadAsync Method
The following code shows an example of using the LoadAsync() method to load a specified ispec into the current application context:
// Load a specified ispec into the current context using the LoadAsync call on the Connection object public async void LoadIspecAsync(string ispecName) { // Call LoadAsync with the ispecName parameter. // The LoadIspecComplete() method is executed when the // Load request to the host system is complete TransmissionObject trObj = await ABSConnection.LoadAsync(ispecName,LoadIspecComplete); if (trObj != null && (trObj.State == TransmissionReturnCode.Ok || trObj.State == TransmissionReturnCode.OkWithSwitch)) { CurrentIspecName = trObj.ObjectClassName; CurrentTO = trObj; } }