public static int Main(string[] args) { startupTime = DateTime.Now; #if !DEBUG try { #endif AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; instance = new Startup(args); instance.Start(); #if !DEBUG } catch (Exception ex) { try { UnhandledException(ex); Process.GetCurrentProcess().Kill(); } catch (Exception) { MessageBox.Show(ex.ToString()); Process.GetCurrentProcess().Kill(); } } #endif return(0); }
public static int Main(string[] args) { State = PaintDotNet.ApplicationState.Starting; try { startupTime = DateTime.Now; try { AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(Startup.OnCurrentDomainAssemblyResolve); instance = new Startup(args); instance.Start(); } catch (Exception exception) { try { if ((instance != null) && instance.canUseCrashDialog) { UnhandledException(exception); } else { UIUtil.MessageBox(null, exception.ToString(), null, MessageBoxButtons.OK, MessageBoxIcon.Hand); } Process.GetCurrentProcess().Kill(); } catch (Exception) { try { UIUtil.MessageBox(null, exception.ToString(), null, MessageBoxButtons.OK, MessageBoxIcon.Hand); Process.GetCurrentProcess().Kill(); } catch (Exception) { Environment.FailFast(null, exception); } } } } finally { State = PaintDotNet.ApplicationState.Exiting; } return(0); }
public static int Main(string[] args) { startupTime = DateTime.Now; #if !DEBUG try { #endif AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; instance = new Startup(args); instance.Start(); #if !DEBUG } catch (Exception ex) { try { UnhandledException(ex); Process.GetCurrentProcess().Kill(); } catch (Exception) { MessageBox.Show(ex.ToString()); Process.GetCurrentProcess().Kill(); } } #endif return 0; }