Moved source to subfolder
This commit is contained in:
33
src/App/Program.cs
Normal file
33
src/App/Program.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Logic;
|
||||
using Repository;
|
||||
|
||||
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.AddSingleton<IPasswordStoreService, PasswordStoreService>();
|
||||
services.AddSingleton<IRepository, JsonRepository>();
|
||||
return services.BuildServiceProvider();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user