static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { LanguageManager.SetLanguage(new CultureInfo(Settings.Default.Language)); } catch (Exception) { LanguageManager.SetLanguage(new CultureInfo("en-US")); // TODO: Write the exception to log file. } Launcher launcher = new Launcher(); Application.Run(launcher); if (launcher.IsSafe == true) { launcher.Dispose(); Application.Run(new Main()); } }
static void Main() { Application.ThreadException += new ThreadExceptionEventHandler(ExceptionHandler.UIThreadException); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptionHandler.UnhandledException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Localization.Culture = new CultureInfo(Settings.Default.Language); Launcher launcher = new Launcher(); launcher.ShowDialog(); if (launcher.IsSafe == true) { launcher.Dispose(); Application.Run(new Main()); } }