forked from Lazrius/DSLauncher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
30 lines (27 loc) · 1015 Bytes
/
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
using System;
using System.IO;
using System.Threading;
using System.Windows.Forms;
namespace DSLauncherV2
{
internal static class Program
{
[STAThread]
private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.ThreadException += Handle;
AppDomain.CurrentDomain.UnhandledException += Handle;
Application.Run(new Primary());
}
private static void Handle(object sender, ThreadExceptionEventArgs e)
{
ExceptionHandler.Throw(ExceptionCode.Unknown, e.Exception.Message + "\n" + e.Exception.InnerException, Form.ActiveForm);
}
private static void Handle(object sender, UnhandledExceptionEventArgs e)
{
ExceptionHandler.Throw(ExceptionCode.Unknown, ((Exception)e.ExceptionObject)?.Message + "\n" + ((Exception)e.ExceptionObject)?.InnerException, Form.ActiveForm);
}
}
}