2024-10-29 09:22:02 +04:00
|
|
|
using ClientBusinessLogic.BusinessLogics;
|
|
|
|
using ClientsContracts.BusinessLogicContracts;
|
|
|
|
using ClientsContracts.StorageContracts;
|
|
|
|
using ClientsDatabaseImplement.Implements;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using System;
|
|
|
|
|
2024-09-30 18:36:22 +04:00
|
|
|
namespace WinForms
|
|
|
|
{
|
|
|
|
internal static class Program
|
|
|
|
{
|
2024-10-29 09:22:02 +04:00
|
|
|
private static ServiceProvider? _serviceProvider;
|
|
|
|
public static ServiceProvider? ServiceProvider => _serviceProvider;
|
|
|
|
|
2024-09-30 18:36:22 +04:00
|
|
|
/// <summary>
|
|
|
|
/// The main entry point for the application.
|
|
|
|
/// </summary>
|
|
|
|
[STAThread]
|
|
|
|
static void Main()
|
|
|
|
{
|
|
|
|
// To customize application configuration such as set high DPI settings or default font,
|
|
|
|
// see https://aka.ms/applicationconfiguration.
|
|
|
|
ApplicationConfiguration.Initialize();
|
2024-10-29 09:22:02 +04:00
|
|
|
var services = new ServiceCollection();
|
|
|
|
ConfigureServices(services);
|
|
|
|
_serviceProvider = services.BuildServiceProvider();
|
|
|
|
Application.Run(_serviceProvider.GetRequiredService<FormMain>());
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void ConfigureServices(ServiceCollection services)
|
|
|
|
{
|
|
|
|
services.AddTransient<IStatusStorage, StatusStorage>();
|
|
|
|
services.AddTransient<IClientStorage, ClientStorage>();
|
|
|
|
services.AddTransient<IStatusLogic, StatusLogic>();
|
|
|
|
services.AddTransient<IClientLogic, ClientLogic>();
|
|
|
|
services.AddTransient<FormMain>();
|
|
|
|
services.AddTransient<FormClient>();
|
|
|
|
services.AddTransient<FormStatus>();
|
2024-09-30 18:36:22 +04:00
|
|
|
}
|
|
|
|
}
|
2024-10-29 09:22:02 +04:00
|
|
|
}
|