forked from GenieClient/Genie4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
39 lines (34 loc) · 1.18 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Windows.Forms;
namespace GenieClient
{
static class Program
{
[STAThread]
static void Main(string[] args)
{
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var host = Host.CreateDefaultBuilder()
.ConfigureServices((context, services) =>
{
ConfigureServices(context.Configuration, services);
})
.Build();
var services = host.Services;
var formMain = services.GetRequiredService<FormMain>();
formMain.DirectConnect(args);
Application.Run(formMain);
}
private static void ConfigureServices(IConfiguration configuration, IServiceCollection services)
{
services.AddSingleton<FormMain>();
//Register services here.
//Example... Service.AddSingleton(Interface, Service);
}
}
}