forked from ElectronNET/Electron.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathElectronHost.cs
More file actions
57 lines (41 loc) · 1.68 KB
/
ElectronHost.cs
File metadata and controls
57 lines (41 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
namespace ElectronNET.Runtime
{
using System.Collections.Immutable;
using ElectronNET.Runtime.Controllers;
using ElectronNET.Runtime.Data;
/// <summary>
/// Default implementation of <see cref="IElectronHost"/> that keeps track of the
/// runtime state shared between the Electron.NET CLI bootstrapper and ASP.NET
/// applications.
/// </summary>
public sealed class ElectronHost : IElectronHost
{
private readonly StartupManager startupManager;
public ElectronHost()
{
this.Options = new ElectronNetOptions();
this.startupManager = new StartupManager(this);
this.startupManager.Initialize();
}
public string ElectronExtraArguments { get; set; }
public int? ElectronSocketPort { get; set; }
public int? AspNetWebPort { get; set; }
public StartupMethod StartupMethod { get; set; }
public DotnetAppType DotnetAppType { get; set; }
public string ElectronExecutable { get; set; }
public ImmutableList<string> ProcessArguments { get; set; }
public BuildInfo BuildInfo { get; set; }
public IElectronNetRuntimeController RuntimeController => this.RuntimeControllerCore;
public int? ElectronProcessId { get; set; }
public ElectronNetOptions Options { get; private set; }
internal RuntimeControllerBase RuntimeControllerCore { get; set; }
public SocketIoFacade GetSocket()
{
return this.RuntimeControllerCore?.Socket;
}
public void ApplyOptions(ElectronNetOptions options)
{
this.Options = options ?? new ElectronNetOptions();
}
}
}