-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
49 lines (39 loc) · 1.57 KB
/
Copy pathProgram.cs
File metadata and controls
49 lines (39 loc) · 1.57 KB
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
using SmallDemoManager.GUI;
using System.Globalization;
namespace SmallDemoManager
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
// Load new GUI Style
try
{
Application.EnableVisualStyles();
#if NETCOREAPP3_1 || NET6_0 || NET7_0 || NET8_0 || NET9_0 || NET10_0
Application.SetHighDpiMode(HighDpiMode.SystemAware);
#endif
CultureInfo cultureInfo = new(CultureInfo.CurrentCulture.TextInfo.CultureName);
Application.SetCompatibleTextRenderingDefault(false);
NewGUI newGUI = new NewGUI();
// If the first argument is an existing file with a ".dem" extension (case-insensitive)
// pass the file path to the form so it can be processed on startup
if (args.Length > 0 && File.Exists(args[0]) && Path.GetExtension(args[0]).Equals(".dem", StringComparison.OrdinalIgnoreCase))
{
// Passes the file to the form at startup
newGUI.SetDemoFileOnStartup(args[0]);
}
Application.CurrentCulture = cultureInfo;
Application.Run(newGUI);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\n" + ex.StackTrace + "\n" + ex.Source + "\n" + ex.InnerException + "\n" + ex.Data + "\n" + ex.TargetSite);
}
}
}
}