How to...

Referencing

To use any io.Connect Desktop functionality, you need to reference the io.Connect .NET library (either as a standalone Glue42.dll file or as a NuGet package), instantiate and initialize a class called Glue42, which provides access to the different io.Connect Desktop functionalities.

As a NuGet Package

The io.Connect .NET library is available as a NuGet package which you can include and configure in your projects.

NuGet Package

As a Standalone File

Another option is to reference the Glue42.dll - the file is delivered with the io.Connect Desktop installer and is located in %LocalAppData%/interop.io/io.Connect Desktop/SDK/Glue42NET/lib/net45/Glue42.dll (you can alternatively use the NUPKG package located in %LocalAppData%/interop.io/io.Connect Desktop/SDK/Glue42NET);

<Reference Include="Glue42">
    <HintPath>..\lib\Glue42.dll</HintPath>
</Reference>

Initialization

The .NET io.Connect library is initialized asynchronously with an optional InitializeOptions object, in which you can specify what io.Connect features you want your app to use.

Here is an example initialization:

var initializeOptions = new InitializeOptions()
    {
        ApplicationName = "cl-wpf1",
        IncludedFeatures = GDFeatures.UseAppManager | GDFeatures.UseGlueWindows
    };

// The initialization options aren't required.
// If skipped, io.Connect will be initialized with the default options
// (default assembly name for ApplicationName and with all features included).

Glue42 io;

Glue42.InitializeGlue(initializeOptions)
    .ContinueWith(ioConnectInit =>
        {
            io = ioConnectInit.Result;
            // Use io.Connect here.
        });

⚠️ Note that after initializing the io.Connect library, you may want to register the windows of your .NET app as io.Connect Windows in order to be able to use io.Connect functionalities. For more details on how to do that correctly and the pitfalls to avoid during window registration, see the Window Management > io.Connect Window section.

App Definition

To add your .NET app to the io.Connect launcher, you must create a JSON file with app definition. Place this file in the %LocalAppData%/interop.io/io.Connect Desktop/UserData/<ENV>-<REG>/apps folder, where <ENV>-<REG> represents the environment and region of io.Connect Desktop (e.g., DEMO-INTEROP.IO).

⚠️ Note that you can also launch manually your interop-enabled .NET app and it will automatically register itself and its child windows in the io.Connect Desktop in-memory store. In this case, your app will be available in the io.Connect environment until the next restart of io.Connect Desktop. This is useful if you have a multi window interop-enabled app with dynamic interop-enabled child windows (e.g., different user configurations, software updates, etc.) - when your main window starts its child windows, they will be registered automatically.

The following is an example configuration for a .NET app:

{
    "title": "Client List WPF v1",
    "type": "exe",
    "name": "cl-wpf1",
    "details": {
        "path": "%GDDIR%/../Demos/ClientProfileDemo/",
        "command": "ClientProfileDemo.exe",
        "parameters": " --mode=1"
    }
}
Property Description
"type" Must be "exe".
"path" The path to the app - relative or absolute. You can also use the %GDDIR% environment variable, which points to the io.Connect Desktop installation folder.
"command" The actual command to execute (the EXE file name).
"parameters" Specifies command line arguments.

For more detailed information about the app definitions, see the Configuration documentation.

See the .NET examples on GitHub which demonstrate various io.Connect Desktop features.

ClickOnce

io.Connect Desktop offers support for ClickOnce apps. Below you can see how to initialize the io.Connect .NET library in your ClickOnce app and how to register a ClickOnce app in io.Connect Desktop.

Initialization

In a ClickOnce app, the .NET io.Connect library is initialized the same way as in other .NET apps:

var initializeOptions = new InitializeOptions()
    {
        ApplicationName = "ClientProfileDemo",
        IncludedFeatures = GDFeatures.UseAppManager | GDFeatures.UseGlueWindows
    };

// The initialization options aren't required.
// If skipped, io.Connect will be initialized with the default options
// (default assembly name for ApplicationName and with all features included).

Glue42 io;
Glue42.InitializeGlue(initializeOptions)
                .ContinueWith(ioConnectInit =>
                    {
                        io = ioConnectInit.Result;
                        // Use io.Connect here.
                    });

You can also set methods for saving and restoring the state of your interop-enabled ClickOnce app:

initializeOptions.SetSaveRestoreStateEndpoint(GetState, RestoreState);

GetState and RestoreState are user defined methods for what information about the ClickOnce app state to save and later restore.

Registering ClickOnce Apps

To show your ClickOnce app in the io.Connect launcher, you must create a configuration JSON file and add it to the app definition store.

Here is an example configuration for a ClickOnce app:

{
    "title": "Client List - ClickOnce",
    "type": "clickonce",
    "name": "cl-clickonce",
    "hidden": false,
    "details": {
        "url": "http://localhost:9091/ClickOnceClientProfileDemo.application",
        "width": 1000,
        "height": 400
    },
    "customProperties": {
        "selectedClient": "john",
        "darkThemeOn": true
    }
}
Property Description
"type" Must be "clickonce".
"url" The web address pointing to the physical location where the ClickOnce app is deployed and from where it will be installed on the user machine.
"customProperties" Context with custom parameters your app can access at runtime through io.GDStartingContext.ApplicationConfig.CustomProperties["propertyName"].

Silverlight

io.Connect Desktop offers a Silverlight library as a version of the io.Connect .NET library. io.Connect Silverlight offers the same features and functionalities as the io.Connect .NET library, it is only tailored to meet the specifications of the MS Silverlight framework.

io.Connect .NET Concepts

Once the io.Connect .NET library has been initialized, your app has access to all io.Connect functionalities. For more detailed information on the different io.Connect capabilities and APIs, see: