IDSDataServiceAsync ClassDSWS API (.NET)

[This is preliminary documentation and is subject to change.]

Defines the class that provides access to asynchronous operations for data service
Inheritance Hierarchy

System Object
  IDSDataServiceBase
    Datastream.DswsApi IDSDataServiceAsync

Namespace: Datastream.DswsApi
Assembly: Datastream.DswsApi.NET4.0 (in Datastream.DswsApi.NET4.0.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public abstract class IDSDataServiceAsync : IDSDataServiceBase
Remarks

The methods exposed by this class can be used to retrieve the data asynchronously. Both event based as well as IAsyncResult based pattern is supported. If you want to use the Task based asynchronous pattern, then you need to reference the library for .NET 4.0.
Examples

The below example shows how to retrieve data asynchronously using the event based asynchronous pattern.
// Make sure you have wired to Completed events ONCE when your application starts
DSClient.DataServiceAsync.GetDataCompleted += (s, args) =>
{
        // Access the results 
        double[] dt1Values = args.Result["PL"]["VOD"].GetValue<double[]>();
        double[] dt2Values = args.Result["PH"]["VOD"].GetValue<double[]>();

        // Show the output in UI 
        // Note that you can use args.UserState if you passed some state during the GetDataAsync call 
        // You might potentially use the state to differentiate your requests
        ShowResultsInUI();

};

// Make the async request
DSClient.DataServiceAsync.GetDataAsync(request, "MyState-Request1");
Version Information

.NET API Framework

Supported in: 4.1, 3.6
See Also