public override bool Init() { base.Init(); // ClodoTemp /* * Forms.WindowSplash splash = new Forms.WindowSplash(); * splash.Visible = true; * * for (int i = 0; i < 100; i++) * { * splash.SetStatus(i.ToString()); * Thread.Sleep(10); * } */ GuiUtils.Init(); Instance = this; if (Engine == null) { Engine = new Eddie.Forms.Engine(); } Engine.TerminateEvent += Engine_TerminateEvent; if (Engine.Initialization(false) == false) { return(false); } FormMain = new Eddie.Forms.Forms.Main(); Engine.FormMain = FormMain; // ClodoTemp2 - remove? Engine.Instance.UiManager.Add(this); Engine.UiStart(); FormMain.LoadPhase(); AppContext = new ApplicationContext(); // ClodoTemp /* * splash.RequestClose(); */ return(true); }
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); } }
public override bool Init(string environmentCommandLine) { Instance = this; AppContext = new ApplicationContext(); base.Init(environmentCommandLine); GuiUtils.Init(); SplashWindow = new Forms.WindowSplash(); SplashWindow.Show(); if (Engine == null) { Engine = new Eddie.Forms.Engine(environmentCommandLine); } Engine.TerminateEvent += Engine_TerminateEvent; Engine.UiManager.Add(this); Engine.Start(); return(true); }