32 lines
924 B
C#
32 lines
924 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Logic;
|
|
|
|
namespace Keychain;
|
|
|
|
class Program
|
|
{
|
|
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;
|
|
window.Application = (Adw.Application)sender;
|
|
window.Show();
|
|
};
|
|
|
|
return application.RunWithSynchronizationContext(null);
|
|
}
|
|
|
|
private static ServiceProvider SetupServices()
|
|
{
|
|
var services = new ServiceCollection();
|
|
//services.AddTransient<IPasswordStoreService, PasswordStoreService>();
|
|
services.AddSingleton<IPasswordStoreService, PasswordStoreService>();
|
|
return services.BuildServiceProvider();
|
|
}
|
|
} |