-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
37 lines (36 loc) · 1.4 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
using System;
using System.IO;
using System.Threading;
using System.Windows.Forms;
namespace EN2NGui
{
internal static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Application.ThreadException += handleException;
AppDomain.CurrentDomain.UnhandledException += handleException;
Directory.SetCurrentDirectory(MiscData.PWD);
Application.Run(new Spla());
if (!MiscData.isSplashExitAbornomal)
Application.Run(new GUI());
}
private static void handleException(object sender, UnhandledExceptionEventArgs e)
{
MessageBox.Show("Critical Error:" + Environment.NewLine + ((Exception)e.ExceptionObject).Message + Environment.NewLine + ((Exception)e.ExceptionObject).StackTrace);
Application.Exit();
}
private static void handleException(object sender, ThreadExceptionEventArgs e)
{
MessageBox.Show("Critical Error:" + Environment.NewLine + e.Exception.Message + Environment.NewLine + e.Exception.StackTrace);
Application.Exit();
}
}
}