2024-02-26 10:12:21 +04:00
|
|
|
using FurnitureAssemblyBusinessLogic.BussinessLogic;
|
|
|
|
using FurnitureAssemblyContracts.BusinessLogicsContracts;
|
|
|
|
using FurnitureAssemblyContracts.StoragesContracts;
|
2024-02-26 11:05:12 +04:00
|
|
|
using FurnitureAssemblyFileImplement.Implements;
|
2024-02-26 10:12:21 +04:00
|
|
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using NLog.Extensions.Logging;
|
|
|
|
|
|
|
|
namespace FurnitureAssemblyView
|
2024-02-26 09:58:03 +04:00
|
|
|
{
|
|
|
|
internal static class Program
|
|
|
|
{
|
2024-02-26 10:12:21 +04:00
|
|
|
private static ServiceProvider? _serviceProvider;
|
2024-02-26 11:05:12 +04:00
|
|
|
|
2024-02-26 10:12:21 +04:00
|
|
|
public static ServiceProvider? ServiceProvider => _serviceProvider;
|
2024-02-26 11:05:12 +04:00
|
|
|
|
2024-02-26 09:58:03 +04:00
|
|
|
/// <summary>
|
2024-02-26 10:12:21 +04:00
|
|
|
/// The main entry point for the application.
|
2024-02-26 09:58:03 +04:00
|
|
|
/// </summary>
|
|
|
|
[STAThread]
|
|
|
|
static void Main()
|
|
|
|
{
|
2024-02-26 10:12:21 +04:00
|
|
|
// To customize application configuration such as set high DPI settings or default font;
|
2024-02-26 09:58:03 +04:00
|
|
|
// see https://aka.ms/applicationconfiguration.
|
|
|
|
ApplicationConfiguration.Initialize();
|
2024-02-26 10:12:21 +04:00
|
|
|
var services = new ServiceCollection();
|
|
|
|
ConfigureServices(services);
|
|
|
|
_serviceProvider = services.BuildServiceProvider();
|
|
|
|
Application.Run(_serviceProvider.GetRequiredService<FormMain>());
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void ConfigureServices(ServiceCollection services)
|
|
|
|
{
|
|
|
|
services.AddLogging(option =>
|
|
|
|
{
|
|
|
|
option.SetMinimumLevel(LogLevel.Information);
|
|
|
|
option.AddNLog("nlog.config");
|
|
|
|
});
|
|
|
|
|
|
|
|
services.AddTransient<IWorkPieceStorage, WorkPieceStorage>();
|
|
|
|
services.AddTransient<IOrderStorage, OrderStorage>();
|
|
|
|
services.AddTransient<IFurnitureStorage, FurnitureStorage>();
|
|
|
|
|
|
|
|
services.AddTransient<IWorkPieceLogic, WorkPieceLogic>();
|
|
|
|
services.AddTransient<IOrderLogic, OrderLogic>();
|
|
|
|
services.AddTransient<IFurnitureLogic, FurnitureLogic>();
|
|
|
|
|
|
|
|
services.AddTransient<FormMain>();
|
|
|
|
services.AddTransient<FormWorkPiece>();
|
|
|
|
services.AddTransient<FormWorkPieces>();
|
|
|
|
services.AddTransient<FormCreateOrder>();
|
|
|
|
services.AddTransient<FormFurniture>();
|
|
|
|
services.AddTransient<FormFurnitures>();
|
|
|
|
services.AddTransient<FormFurnitureWorkPiece>();
|
2024-02-26 09:58:03 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|