diff options
author | Emma@Rory& <root@rory.gay> | 2023-07-26 21:02:50 +0200 |
---|---|---|
committer | Emma@Rory& <root@rory.gay> | 2023-07-26 21:02:50 +0200 |
commit | 2e89a0717a60598904c92499adb7e01b2075fbb9 (patch) | |
tree | 56b9b7f07180154d9d98dafa91d7c16a0a872100 /MatrixRoomUtils.Desktop/App.axaml.cs | |
parent | Start of nix flake (diff) | |
download | MatrixUtils-2e89a0717a60598904c92499adb7e01b2075fbb9.tar.xz |
MRU desktop start
Diffstat (limited to 'MatrixRoomUtils.Desktop/App.axaml.cs')
-rw-r--r-- | MatrixRoomUtils.Desktop/App.axaml.cs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/MatrixRoomUtils.Desktop/App.axaml.cs b/MatrixRoomUtils.Desktop/App.axaml.cs index 3dfcdee..3fe8862 100644 --- a/MatrixRoomUtils.Desktop/App.axaml.cs +++ b/MatrixRoomUtils.Desktop/App.axaml.cs @@ -4,6 +4,7 @@ using Avalonia.Markup.Xaml; using MatrixRoomUtils.Core.Services; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using Sentry; namespace MatrixRoomUtils.Desktop; @@ -16,20 +17,24 @@ public partial class App : Application { public override void OnFrameworkInitializationCompleted() { host = Host.CreateDefaultBuilder().ConfigureServices((ctx, services) => { - services.AddScoped<MRUDesktopConfiguration>(); - services.AddScoped<TieredStorageService>(x => + services.AddSingleton<MRUDesktopConfiguration>(); + services.AddSingleton<SentryService>(); + services.AddSingleton<TieredStorageService>(x => new( cacheStorageProvider: new FileStorageProvider(x.GetService<MRUDesktopConfiguration>().CacheStoragePath), - dataStorageProvider: new FileStorageProvider(x.GetService<MRUDesktopConfiguration>().CacheStoragePath) + dataStorageProvider: new FileStorageProvider(x.GetService<MRUDesktopConfiguration>().DataStoragePath) ) ); + services.AddSingleton(new RoryLibMatrixConfiguration() { + AppName = "MatrixRoomUtils.Desktop" + }); services.AddRoryLibMatrixServices(); // foreach (var commandClass in new ClassCollector<ICommand>().ResolveFromAllAccessibleAssemblies()) { // Console.WriteLine($"Adding command {commandClass.Name}"); // services.AddScoped(typeof(ICommand), commandClass); // } - services.AddScoped<MRUStorageWrapper>(); - services.AddScoped<MainWindow>(); + services.AddSingleton<MRUStorageWrapper>(); + services.AddSingleton<MainWindow>(); services.AddSingleton(this); }).UseConsoleLifetime().Build(); |