static void Main() { try { if (Environment.OSVersion.Version.Major >= 6) { NativeMethods.SetProcessDPIAware(); } //Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Core.Platform.Instance = new Eddie.Platform.Windows.Platform(); CommandLine.InitSystem(Environment.CommandLine); if (CommandLine.SystemEnvironment.Exists("cli")) { Core.Engine engine = new Core.Engine(); if (engine.Initialization(true)) { engine.ConsoleStart(); } } else { m_client = new Eddie.Forms.UiClient(); m_client.Init(); } } catch (Exception e) { MessageBox.Show(e.Message, Constants.Name, MessageBoxButtons.OK, MessageBoxIcon.Error); } // Application.Run must be outside the catch above, otherwise it's not unhandled if ((m_client != null) && (m_client.AppContext != null)) { Application.Run(m_client.AppContext); } }
static void Main() { try { if (Environment.OSVersion.Version.Major >= 6) { NativeMethods.SetProcessDPIAware(); } //Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += new ThreadExceptionEventHandler(ApplicationThreadException); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Core.Platform.Instance = new Eddie.Platform.Windows.Platform(); if (new CommandLine(Environment.CommandLine, true, false).Exists("cli")) // TOFIX, not need anymore when every OS have a CLI executable. { Core.ConsoleEdition.UiClient client = new Core.ConsoleEdition.UiClient(); client.Init(Environment.CommandLine); } else { m_client = new UiClient(); m_client.Init(Environment.CommandLine); } } catch (Exception e) { MessageBox.Show(e.Message, Constants.Name, MessageBoxButtons.OK, MessageBoxIcon.Error); } // Application.Run must be outside the catch above, otherwise it's not unhandled if ((m_client != null) && (m_client.AppContext != null)) { Application.Run(m_client.AppContext); } }