| | |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Hosting; |
| | | using Moli.Desktop.Host; |
| | | using Moli.Desktop.Runtime; |
| | | |
| | | namespace Moli.Desktop; |
| | | |
| | |
| | | |
| | | _host = DesktopHostBuilder.Create(e.Args).Build(); |
| | | await _host.StartAsync(); |
| | | await _host.Services.GetRequiredService<IDesktopRuntime>().StartAsync(); |
| | | |
| | | var mainWindow = _host.Services.GetRequiredService<MainWindow>(); |
| | | mainWindow.Show(); |
| | |
| | | { |
| | | if (_host is not null) |
| | | { |
| | | await _host.Services.GetRequiredService<IDesktopRuntime>().ShutdownAsync(); |
| | | await _host.StopAsync(TimeSpan.FromSeconds(5)); |
| | | _host.Dispose(); |
| | | } |