35 lines
979 B
C#
35 lines
979 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using NLog.Extensions.Logging;
|
|
using System;
|
|
|
|
namespace AirBomber
|
|
{
|
|
internal static class Program
|
|
{
|
|
[STAThread]
|
|
static void Main()
|
|
{
|
|
ApplicationConfiguration.Initialize();
|
|
|
|
var services = new ServiceCollection();
|
|
ConfigureServices(services);
|
|
|
|
using (ServiceProvider ServiceProvider = services.BuildServiceProvider())
|
|
{
|
|
Application.Run(ServiceProvider.GetRequiredService<FormEntityCollection>());
|
|
}
|
|
}
|
|
|
|
private static void ConfigureServices(IServiceCollection services)
|
|
{
|
|
services.AddSingleton<FormEntityCollection>().AddLogging(
|
|
option =>
|
|
{
|
|
option.SetMinimumLevel(LogLevel.Information);
|
|
option.AddNLog("nlog.config");
|
|
}
|
|
);
|
|
}
|
|
}
|
|
} |