2025-10-13 13:24:28 +02:00
|
|
|
|
namespace ElectronNET
|
|
|
|
|
|
{
|
|
|
|
|
|
using ElectronNET.API;
|
|
|
|
|
|
using ElectronNET.Runtime;
|
|
|
|
|
|
using ElectronNET.Runtime.Controllers;
|
|
|
|
|
|
using ElectronNET.Runtime.Data;
|
2025-11-09 12:05:07 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Immutable;
|
|
|
|
|
|
using System.Threading.Tasks;
|
2025-10-13 13:24:28 +02:00
|
|
|
|
|
|
|
|
|
|
public static class ElectronNetRuntime
|
|
|
|
|
|
{
|
|
|
|
|
|
internal static StartupManager StartupManager;
|
|
|
|
|
|
|
|
|
|
|
|
internal const int DefaultSocketPort = 8000;
|
|
|
|
|
|
internal const int DefaultWebPort = 8001;
|
|
|
|
|
|
internal const string ElectronPortArgumentName = "electronPort";
|
|
|
|
|
|
internal const string ElectronPidArgumentName = "electronPID";
|
2026-05-09 17:03:32 +02:00
|
|
|
|
internal const string ElectronAuthTokenArgumentName = "electronAuthToken";
|
2025-10-13 13:24:28 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>Initializes the <see cref="ElectronNetRuntime"/> class.</summary>
|
|
|
|
|
|
static ElectronNetRuntime()
|
|
|
|
|
|
{
|
|
|
|
|
|
StartupManager = new StartupManager();
|
|
|
|
|
|
StartupManager.Initialize();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-15 09:31:19 +01:00
|
|
|
|
public static string ElectronExtraArguments { get; set; }
|
|
|
|
|
|
|
2026-05-09 17:03:32 +02:00
|
|
|
|
public static string ElectronAuthToken { get; internal set; }
|
|
|
|
|
|
|
2025-10-13 13:24:28 +02:00
|
|
|
|
public static int? ElectronSocketPort { get; internal set; }
|
|
|
|
|
|
|
|
|
|
|
|
public static int? AspNetWebPort { get; internal set; }
|
|
|
|
|
|
|
|
|
|
|
|
public static StartupMethod StartupMethod { get; internal set; }
|
|
|
|
|
|
|
|
|
|
|
|
public static DotnetAppType DotnetAppType { get; internal set; }
|
|
|
|
|
|
|
|
|
|
|
|
public static string ElectronExecutable { get; internal set; }
|
|
|
|
|
|
|
|
|
|
|
|
public static ImmutableList<string> ProcessArguments { get; internal set; }
|
|
|
|
|
|
|
|
|
|
|
|
public static BuildInfo BuildInfo { get; internal set; }
|
|
|
|
|
|
|
|
|
|
|
|
public static IElectronNetRuntimeController RuntimeController => RuntimeControllerCore;
|
|
|
|
|
|
|
|
|
|
|
|
// The below properties are non-public
|
|
|
|
|
|
internal static RuntimeControllerBase RuntimeControllerCore { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
internal static int? ElectronProcessId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
internal static Func<Task> OnAppReadyCallback { get; set; }
|
|
|
|
|
|
|
2026-03-05 11:25:22 +01:00
|
|
|
|
internal static ISocketConnection GetSocket()
|
2025-10-13 13:24:28 +02:00
|
|
|
|
{
|
|
|
|
|
|
return RuntimeControllerCore?.Socket;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-11-15 08:05:31 +01:00
|
|
|
|
}
|