using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace Tagashi_File_Hub;

internal static class Program
{
    /// <summary>
    ///     The main entry point for the application.
    /// </summary>
    [STAThread]
    private static void Main()
    {
        // To customize application configuration such as set high DPI settings or default font,
        // see https://aka.ms/applicationconfiguration.
        ApplicationConfiguration.Initialize();
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);

        var hostBuilder = new HostBuilder().ConfigureServices((hostContext, services) =>
        {
            services.AddSingleton<MainForm>();
        });

        using var host = hostBuilder.Build();
        var serviceProvider = host.Services;
        var mainForm = serviceProvider.GetService<MainForm>();

        Application.Run(mainForm);
    }
}