-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathProgram.cs
More file actions
42 lines (38 loc) · 1.13 KB
/
Program.cs
File metadata and controls
42 lines (38 loc) · 1.13 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
using System;
using System.Threading;
using System.Windows.Forms;
namespace PoE_Price_Lister
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
#if !DEBUG
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
#endif
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
Shutdown(e.Exception);
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Shutdown(e.ExceptionObject as Exception);
}
static void Shutdown(Exception e)
{
MessageBox.Show(e.Message + "\n" + e.StackTrace, "Exception");
if (e.InnerException != null)
MessageBox.Show(e.InnerException.Message + "\n" + e.InnerException.StackTrace, "Inner Exception");
Application.Exit();
}
}
}