-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathProgram.cs
More file actions
38 lines (31 loc) · 898 Bytes
/
Program.cs
File metadata and controls
38 lines (31 loc) · 898 Bytes
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.Threading;
namespace GLGUI.Example
{
public static class Program
{
[STAThread]
public static int Main(string[] args)
{
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
new MainForm().Run();
return 0;
}
private static void HandleUnhandledException(Object o)
{
Exception e = o as Exception;
if (e != null)
{
Console.WriteLine(e.ToString());
}
}
private static void OnUnhandledException(Object sender, UnhandledExceptionEventArgs e)
{
HandleUnhandledException(e.ExceptionObject);
}
private static void OnGuiUnhandedException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
HandleUnhandledException(e.Exception);
}
}
}