2024-11-27 00:03:35 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using Unity;
|
|
|
|
|
using Unity.Lifetime;
|
|
|
|
|
using YourNamespace.Repositories;
|
|
|
|
|
using YourNamespace.Repositories.Implementations;
|
|
|
|
|
using YourNamespace.Forms;
|
|
|
|
|
|
|
|
|
|
namespace YourNamespace
|
2024-10-30 09:11:23 +04:00
|
|
|
|
{
|
2024-11-27 00:03:35 +04:00
|
|
|
|
static class Program
|
2024-10-30 09:11:23 +04:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2024-11-27 00:03:35 +04:00
|
|
|
|
/// The main entry point for the application.
|
2024-10-30 09:11:23 +04:00
|
|
|
|
/// </summary>
|
|
|
|
|
[STAThread]
|
|
|
|
|
static void Main()
|
|
|
|
|
{
|
2024-11-27 00:03:35 +04:00
|
|
|
|
Application.EnableVisualStyles();
|
|
|
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
|
|
|
|
|
|
|
var container = CreateContainer();
|
|
|
|
|
Application.Run(container.Resolve<FormMain>());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static IUnityContainer CreateContainer()
|
|
|
|
|
{
|
|
|
|
|
var container = new UnityContainer();
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
container.RegisterType<IPassengerRepository, PassengerRepository>(new TransientLifetimeManager());
|
|
|
|
|
container.RegisterType<ITicketRepository, TicketRepository>(new TransientLifetimeManager());
|
|
|
|
|
container.RegisterType<IFlightRepository, FlightRepository>(new TransientLifetimeManager());
|
|
|
|
|
container.RegisterType<IEmployeeRepository, EmployeeRepository>(new TransientLifetimeManager());
|
|
|
|
|
container.RegisterType<IPlaneRepository, PlaneRepository>(new TransientLifetimeManager());
|
|
|
|
|
container.RegisterType<IAirportRepository, AirportRepository>(new TransientLifetimeManager());
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
container.RegisterType<FormMain>(new ContainerControlledLifetimeManager());
|
|
|
|
|
container.RegisterType<FormPassenger>(new TransientLifetimeManager());
|
|
|
|
|
container.RegisterType<FormTicket>(new TransientLifetimeManager());
|
|
|
|
|
container.RegisterType<FormFlight>(new TransientLifetimeManager());
|
|
|
|
|
container.RegisterType<FormEmployee>(new TransientLifetimeManager());
|
|
|
|
|
container.RegisterType<FormPlane>(new TransientLifetimeManager());
|
|
|
|
|
container.RegisterType<FormAirport>(new TransientLifetimeManager());
|
|
|
|
|
|
|
|
|
|
return container;
|
2024-10-30 09:11:23 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|