private static SplashForm splash;// = new SplashForm(); internal static void Launch() { Application.CurrentCulture = CultureInfo.InvariantCulture; Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); splash = new SplashForm(); splash.Show(); Timer timer = new Timer(); //Configure this timer to restart each second ( 1000 millis) timer.Interval = 1000; timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); timer.Start(); //splash.Refresh(); //Application.DoEvents(); Application.DoEvents(); MainModule.Initialize("data"); splash.SetLoadProgress(50); splash.Refresh(); Application.DoEvents(); UpdaterHelper.UpdateInfo info; info = UpdaterHelper.CheckFromUpdates(); Application.DoEvents(); if (info.UpdateAvailable) { UpdateForm updateForm; updateForm = new UpdateForm(info); updateForm.ShowDialog(); Application.DoEvents(); } splash.SetLoadProgress(60); splash.Refresh(); Application.DoEvents(); IconsManager.Initialize(); Application.DoEvents(); MainForm main = new MainForm(); //if (runSingleInstance) //{ // main.HandleCreated += new EventHandler(main_HandleCreated); //} GC.Collect(); timer.Stop(); timer.Close(); splash.SetLoadProgress(100); splash.Refresh(); Application.DoEvents(); splash.Close(); splash = null; Application.DoEvents(); Application.Run(main); } //Launch
static void Main() { ThreadExceptionHandler handler = new ThreadExceptionHandler(); Application.ThreadException += new ThreadExceptionEventHandler(handler.Application_ThreadException); Application.SetCompatibleTextRenderingDefault(false); SplashForm splash = new SplashForm(); splash.Show(); splash.Refresh(); Application.EnableVisualStyles(); Application.Run(new Form1(splash)); }
static void Main() { Application.SetCompatibleTextRenderingDefault(false); _splash = new SplashForm(); _splash.Show(); _splash.Refresh(); Application.EnableVisualStyles(); MainForm mainForm = new MainForm(); mainForm.Load += new EventHandler(mainForm_Load); Application.Run(mainForm); }
private void OpenForexPlatformBeta_Load(object sender, EventArgs e) { //_controlAutomationManager = new ApplicationControlAutomationManager(this); //_controlAutomationManager.RegisterControlHandler(typeof(Control), new HelpHandler()); this.Visible = false; SplashForm splash = new SplashForm(); splash.StartPosition = FormStartPosition.CenterScreen; splash.Show(); splash.Refresh(); combinedContainerControl.ClearControls(); combinedContainerControl.ImageList = this.imageList; combinedContainerControl.SelectedTabbedControlChangedEvent += new CombinedContainerControl.ControlUpdateDelegate(combinedContainerControl_FocusedControlChangedEvent); Platform platform = new Platform("DefaultPlatform"); if (LoadPlatform(platform) == false) {// Failed to load the platform. this.Close(); } else { // Precreate all controls before showing anything, to evade unpleasant flickering on startup. this.CreateControl(); Application.DoEvents(); this.Visible = true; this.WindowState = FormWindowState.Maximized; } splash.Hide(); statusStripToolStripMenuItem.Checked = statusStripMain.Visible; toolStripMenuItemFullDiagnosticsMode.Enabled = platform.Settings.DeveloperMode; }
internal static void Launch() { Application.CurrentCulture = CultureInfo.InvariantCulture; Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); splash = new SplashForm(); splash.Show(); Timer timer = new Timer(); //Configure this timer to restart each second ( 1000 millis) timer.Interval = 1000; timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); timer.Start(); //splash.Refresh(); //Application.DoEvents(); Application.DoEvents(); MainModule.Initialize("data"); splash.SetLoadProgress(50); splash.Refresh(); Application.DoEvents(); UpdaterHelper.UpdateInfo info; info = UpdaterHelper.CheckFromUpdates(); Application.DoEvents(); if (info.UpdateAvailable) { UpdateForm updateForm; updateForm = new UpdateForm(info); updateForm.ShowDialog(); Application.DoEvents(); } splash.SetLoadProgress(60); splash.Refresh(); Application.DoEvents(); IconsManager.Initialize(); Application.DoEvents(); MainForm main = new MainForm(); //if (runSingleInstance) //{ // main.HandleCreated += new EventHandler(main_HandleCreated); //} GC.Collect(); timer.Stop(); timer.Close(); splash.SetLoadProgress(100); splash.Refresh(); Application.DoEvents(); splash.Close(); splash = null; Application.DoEvents(); Application.Run(main); }
private static void Main() { try { Application.EnableVisualStyles(); Application.DoEvents(); SplashForm splashForm = new SplashForm(); splashForm.Show(); splashForm.Refresh(); MainForm mainForm = new MainForm(splashForm); Application.Run(mainForm); } catch (Exception ex) { Messenger.ShowError(ex); } }