Example #1
0
        static void guiExceptionLogger(object sender, ThreadExceptionEventArgs e)
        {
#if !DEBUG
            using (var form = new Stareater.GUI.FormError(e.Exception.ToString()))
                form.ShowDialog();
#else
            Trace.TraceError(e.Exception.ToString());
#endif
        }
Example #2
0
        static void logException(Exception e)
        {
            var textBuilder = new StringBuilder();

            unpackText(textBuilder, e);

#if !DEBUG
            using (var form = new Stareater.GUI.FormError(textBuilder.ToString()))
                form.ShowDialog();
#else
            Trace.TraceError(textBuilder.ToString());
#endif
        }
Example #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            Application.ThreadException += guiExceptionLogger;

#if !DEBUG
            try
            {
#endif
            Application.Run(new Stareater.GUI.FormMain());
#if !DEBUG
        }

        catch (Exception e)
        {
            using (var form = new Stareater.GUI.FormError(e.ToString()))
                form.ShowDialog();
        }
#endif
        }