Search Results for

    Show / Hide Table of Contents

    Desktop System API migration

    In the adapter for .NET 6+, the Desktop System API is not part of the base adapter package. It is provided as an extension, as described in the Desktop System extension article.

    Once you have installed the package you can follow the examples below for all supported functions. For any functions that are not directly supported in the .NET 6+ adapter, you can leverage the Channel API and a JavaScript-based provider to make proxy calls to the equivalent API from JavaScript.

    One of the main differences to note is that you can use await on all functions, rather than providing a callback. All functions return defined types rather than abstract JSON.

    • .NET Framework style
    • .NET 6+ style
    runtime.System.getAllApplications((ack) =>
    {
        var data = ack.getData();
        foreach ( var appToken in data.ToArray() )
        {
            Debug.WriteLine(appToken["uuid"]);
        }    
    });
    
    var desktopSystem = runtime.GetService<IDesktopSystem>();
    
    var runningApps = await desktopSystem.GetAllApplicationsAsync();
    
    foreach ( var app in runningApps )
    {
        Debug.WriteLine(app.UUID);
    }  
    
    
    In This Article
    Back to top Copyright OpenFin