aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/Program.cs
blob: d6c89794bcb4ba9b4bbf5c1142a78954facdc058 (plain) (blame)
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
43
44
45
46
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;

namespace ShiftOS.Engine
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        public static void Main()
        {
            try
            {
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
                //Taxes: Remote Desktop Connection and painting
                //http://blogs.msdn.com/oldnewthing/archive/2006/01/03/508694.aspx
                Application.ThreadException += (o, a) =>
                {
                    CrashHandler.Start(a.Exception);
                };

                Application.ApplicationExit += (o, a) =>
                 {
                     ServerManager.Disconnect();

                 //I really want a glass of juice.
                 //Process.GetCurrentProcess().Kill();
                 };
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                //Application.Run(new Desktop());
            }
            catch(Exception ex)
            {
                CrashHandler.Start(ex);

            }
        }
    }
}