forked from DJDoubleD/QobuzDownloaderX-MOD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
56 lines (46 loc) · 1.89 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using Bluegrams.Application;
using QobuzDownloaderX.Properties;
using QobuzDownloaderX.Shared;
using QobuzDownloaderX.Shared.Tools;
using QobuzDownloaderX.View;
using System;
using System.Globalization;
using System.Windows.Forms;
namespace QobuzDownloaderX
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
private static void Main()
{
// Make the default settings class portable
PortableSettingsProviderBase.SettingsDirectory = FileTools.GetInitializedSettingsDir();
// Global override of every settings "Roaming" property.
PortableSettingsProviderBase.AllRoaming = true;
PortableJsonSettingsProvider.ApplyProvider(Settings.Default);
// Use en-US formatting everywhere for consistency
var culture = CultureInfo.GetCultureInfo("en-US");
//Culture for any thread
CultureInfo.DefaultThreadCurrentCulture = culture;
//Culture for UI in any thread
CultureInfo.DefaultThreadCurrentUICulture = culture;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Create logging dir and clean older logs if present
Globals.LoggingDir = FileTools.GetInitializedLogDir();
// Initialise forms
Globals.LoginForm = new LoginForm();
Globals.AboutForm = new AboutForm();
// Register EventHandler to release resources on exit
Application.ApplicationExit += ApplicationExit;
Application.Run(Globals.LoginForm);
}
private static void ApplicationExit(object sender, EventArgs e)
{
QobuzApiServiceManager.ReleaseApiService();
}
}
}