-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
41 lines (37 loc) · 1.23 KB
/
Program.cs
File metadata and controls
41 lines (37 loc) · 1.23 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
using System;
using System.Windows.Forms;
namespace GorstakBenchmark
{
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.ThreadException += (s, e) =>
{
try { MessageBox.Show(e.Exception.ToString(), "Gorstak Benchmark - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
catch { }
};
AppDomain.CurrentDomain.UnhandledException += (s, e) =>
{
try
{
var ex = e.ExceptionObject as Exception;
MessageBox.Show(ex != null ? ex.ToString() : e.ExceptionObject.ToString(),
"Gorstak Benchmark - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch { }
};
try
{
Application.Run(new MainForm());
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Gorstak Benchmark - Startup Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}