Extensions
Adapter extensions are a way of adding extra optional functionality to the .NET adapter. This is how less often used functionality can be brought in.
An extension is shipped as a seperate NuGet package which you will need to reference and then install as part of the runtime creation phase.
For example, out of the box the adapter only provides debug console level logging but we provide an extension that extends the logging capabilties to log to a file using SeriLog.
You can see below the use of the *UseSerilogLogging() method as part of the Runtime creation. This will take care of adding the logging the capabilities to the newly created Runtime instance.
var runtime = new RuntimeFactory()
.UseSeriLogLogging()
.GetRuntimeInstance(new RuntimeOptions
{
Version = "stable",
UUID = "your-uuid",
LicenseKey = "your-license-key"
});
Another example of an extension is the Desktop System Extension (OpenFin.Net.Adapter.Extensions.DesktopSystem). Once enabled this will allow you to call a variety of OpenFin desktop apis.
For example, assuming you have reference the OpenFin.Net.Adapter.Extensions.DesktopSystem package:
var runtime = new RuntimeFactory()
.UseSeriLogLogging()
.UseDesktopSystem()
.GetRuntimeInstance(new RuntimeOptions
{
Version = "stable",
UUID = "your-uuid",
LicenseKey = "your-license-key"
});
await runtime.ConnectAsync();
var desktop = runtime.GetService<IDesktopSystem>();
var runningApps = desktop.GetAllApplicationsAsync();
foreach ( var app in runningApps) {
Debug.WriteLine( app.UUID );
}