Files
Keys/App/Program.cs

33 lines
924 B
C#
Raw Normal View History

2025-09-17 17:50:29 +02:00
using Microsoft.Extensions.DependencyInjection;
2025-09-22 13:08:08 +02:00
using Logic;
2025-09-22 15:35:31 +02:00
using Repository;
2025-09-17 17:50:29 +02:00
namespace Keychain;
2025-09-17 17:50:29 +02:00
class Program
2025-09-13 17:36:46 +02:00
{
2025-09-17 17:50:29 +02:00
private static ServiceProvider? provider;
static int Main()
{
provider = SetupServices();
var application = Adw.Application.New("org.typomustakes.keychain", Gio.ApplicationFlags.FlagsNone);
application.OnActivate += (sender, args) =>
{
var window = new UI.MainWindow().Window;
2025-09-17 17:50:29 +02:00
window.Application = (Adw.Application)sender;
window.Show();
};
return application.RunWithSynchronizationContext(null);
}
2025-09-13 17:36:46 +02:00
2025-09-17 17:50:29 +02:00
private static ServiceProvider SetupServices()
{
var services = new ServiceCollection();
2025-09-22 13:08:08 +02:00
services.AddSingleton<IPasswordStoreService, PasswordStoreService>();
2025-09-22 15:35:31 +02:00
services.AddSingleton<IRepository, JsonRepository>();
2025-09-17 17:50:29 +02:00
return services.BuildServiceProvider();
}
}