static void Main() { try { //Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); Core.Platform.Instance = new Eddie.Platform.Linux.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 UiClient(); m_client.Engine = new Engine(); m_client.Init(); } } catch (Exception e) { Console.WriteLine(e.StackTrace); 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)) { System.Windows.Forms.Application.Run(m_client.AppContext); } }
static void Main() { try { //Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += new ThreadExceptionEventHandler(ApplicationThreadException); //Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); // Mono Not Supported AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Core.Platform.Instance = new Eddie.Platform.Linux.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.Engine = new Engine(Environment.CommandLine); m_client.Init(Environment.CommandLine); } } catch (Exception e) { Console.WriteLine(e.StackTrace); 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)) { System.Windows.Forms.Application.Run(m_client.AppContext); } }