30 lines
841 B
C#
30 lines
841 B
C#
|
|
using Feladat1.UI.MainWindow;
|
|||
|
|
using Logic;
|
|||
|
|
using Microsoft.Extensions.DependencyInjection;
|
|||
|
|
using Repository;
|
|||
|
|
|
|||
|
|
namespace Feladat1;
|
|||
|
|
|
|||
|
|
class Program
|
|||
|
|
{
|
|||
|
|
static int Main()
|
|||
|
|
{
|
|||
|
|
var application = Adw.Application.New("org.piper.feladat1", Gio.ApplicationFlags.FlagsNone);
|
|||
|
|
application.OnActivate += (sender, args) =>
|
|||
|
|
{
|
|||
|
|
var window = new MainWindow().Window;
|
|||
|
|
window.Application = (Adw.Application)sender;
|
|||
|
|
window.Show();
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
return application.RunWithSynchronizationContext(null);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private static ServiceProvider SetupServices()
|
|||
|
|
{
|
|||
|
|
var services = new ServiceCollection();
|
|||
|
|
services.AddSingleton<IRepository, JsonRepository>();
|
|||
|
|
services.AddSingleton<IUserService, UserService>();
|
|||
|
|
return services.BuildServiceProvider();
|
|||
|
|
}
|
|||
|
|
}
|