Продолжение рефакторинга (вынесение WPF в отдельный проект)
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Pf2e.Scrapper.Importers.Implementations.Aonprd;
|
||||
using Pf2e.Scrapper.Importers.Implementations.FoundryEn;
|
||||
using Pf2e.Scrapper.WPF;
|
||||
|
||||
namespace Pf2e.Scrapper;
|
||||
|
||||
public static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
public static void Main()
|
||||
{
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
|
||||
// Application.SetHighDpiMode(HighDpiMode.SystemAware);
|
||||
/*
|
||||
#pragma warning disable WFO5001
|
||||
Application.SetColorMode(SystemColorMode.System);
|
||||
#pragma warning restore WFO5001
|
||||
*/
|
||||
IServiceCollection services = RegisterServices();
|
||||
|
||||
IServiceProvider serviceProvider = services.BuildServiceProvider();
|
||||
|
||||
ImportApplication app = ActivatorUtilities.CreateInstance<ImportApplication>(
|
||||
serviceProvider
|
||||
);
|
||||
|
||||
app.Run();
|
||||
// Application.Run(app);
|
||||
}
|
||||
|
||||
private static IServiceCollection RegisterServices()
|
||||
{
|
||||
IServiceCollection services = new ServiceCollection();
|
||||
|
||||
services.RegisterWpfServices();
|
||||
|
||||
ImportApplication.RegisterServices(services);
|
||||
|
||||
AonprdImporter.RegisterServices(services);
|
||||
FoundryEnImporter.RegisterServices(services);
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user