콘텐츠로 이동

NetWivApplication

이 콘텐츠는 아직 번역되지 않았습니다.

Namespace NetWiv.Hosting · Assembly NetWiv.Hosting

public sealed class NetWivApplication : IDisposable, IAsyncDisposable

A 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.

public App App { get; }
public IConfiguration Configuration { get; }
public IHostEnvironment Environment { get; }
public AppHandle Handle { get; }
public IHostApplicationLifetime Lifetime { get; }
public ILogger Logger { get; }
public IServiceProvider Services { get; }
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.

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.

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.