2023-11-28 17:17:38 +04:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using NLog.Extensions.Logging;
|
|
|
|
|
2023-10-10 19:30:57 +04:00
|
|
|
namespace ProjectElectricLocomotive
|
2023-09-27 09:51:02 +04:00
|
|
|
{
|
|
|
|
internal static class Program
|
|
|
|
{
|
|
|
|
/// <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();
|
2023-11-28 17:17:38 +04:00
|
|
|
var services = new ServiceCollection();
|
|
|
|
ConfigureServices(services);
|
|
|
|
using (ServiceProvider serviceProvider = services.BuildServiceProvider())
|
|
|
|
{
|
|
|
|
Application.Run(serviceProvider.GetRequiredService<FormLocomotiveCollection>());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private static void ConfigureServices(ServiceCollection services)
|
|
|
|
{
|
|
|
|
services.AddSingleton<FormLocomotiveCollection>().AddLogging(option =>
|
|
|
|
{
|
|
|
|
option.SetMinimumLevel(LogLevel.Information);
|
|
|
|
option.AddNLog("nlog.config");
|
|
|
|
});
|
2023-09-27 09:51:02 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|