Class DesktopHost
Provides a desktop head's whole run: one binary with three jobs, chosen by the first word on the command line, the service that holds the app, the window that shows it, and the commands that drive it from a shell.
public static class DesktopHost
- Inheritance
-
DesktopHost
- Inherited Members
Remarks
A head gives the product facts only it can give (DesktopInitParams), a platform package the machine
facts only it can give (IDesktopPlatform), and this joins them. The VPN service is a binary of its own
beside it, the VPN host, which the service starts at each connect; dev runs the app and the window in one
process. Run alone, the window's executable opens the window, and the command a person types prints its help.
Methods
HostDaemonStoppedBySignal(DaemonRun, CancellationToken)
Runs the service where a signal stops it, as on Linux: the parser cancels the token at the signal, and the app's graceful close then gives way to its quick one after a while, before the process ends.
public static Task<int> HostDaemonStoppedBySignal(DaemonRun run, CancellationToken cancellationToken)
Parameters
runDaemonRunThe service's run.
cancellationTokenCancellationTokenThe token the parser cancels at the signal.
Returns
Run(string[], DesktopInitParams, IDesktopPlatform)
Runs what the command line asks for, and blocks until it ends: the work runs off the calling thread and the UI on
it, so a head calls it from its Main, on Windows its [STAThread] one.
public static int Run(string[] args, DesktopInitParams initParams, IDesktopPlatform platform)
Parameters
argsstring[]The process's command-line arguments.
initParamsDesktopInitParamsThe head's init params.
platformIDesktopPlatformWhat the platform says for itself.
Returns
- int
The process's exit code.