NetWivApplication
Namespace NetWiv.Hosting · Assembly NetWiv.Hosting
public sealed class NetWivApplication : IDisposable, IAsyncDisposableA NetWiv desktop app running inside the .NET Generic Host.
NetWivApplication.Run starts hosted services, runs the native event loop on the calling thread and stops the host after the loop returns. Call it from the process’s original main thread, as with App.Run. There is intentionally no RunAsync: an asynchronous continuation cannot own the native UI loop.
Properties
Section titled “Properties”public App App { get; }Configuration
Section titled “Configuration”public IConfiguration Configuration { get; }Environment
Section titled “Environment”public IHostEnvironment Environment { get; }Handle
Section titled “Handle”public AppHandle Handle { get; }Lifetime
Section titled “Lifetime”public IHostApplicationLifetime Lifetime { get; }Logger
Section titled “Logger”public ILogger Logger { get; }Services
Section titled “Services”public IServiceProvider Services { get; }Methods
Section titled “Methods”CreateBuilder
Section titled “CreateBuilder”public static NetWivApplicationBuilder CreateBuilder();public static NetWivApplicationBuilder CreateBuilder(string[] args);public static NetWivApplicationBuilder CreateBuilder(HostApplicationBuilderSettings settings);Creates a builder. An unset content root defaults to the application directory, not the working directory.
Dispose
Section titled “Dispose”public void Dispose();Stops accepting commands, cancels those in flight and waits for them for up to HostOptions.ShutdownTimeout, then disposes the app and its plugins, then the service provider.
DisposeAsync
Section titled “DisposeAsync”public ValueTask DisposeAsync();public void Run();Starts the host, runs the desktop event loop and stops the host. IHostApplicationLifetime.StopApplication exits the event loop. After the loop returns, commands still in flight are cancelled and awaited for up to HostOptions.ShutdownTimeout before hosted services stop. A restart requested through AppHandle.Restart relaunches only after that, once both the app and the service provider have been disposed.