Beispiel #1
0
 private void OnLoad(object sender, EventArgs e)
 {
     // Simulate doing a lot of work here.
     System.Threading.Thread.Sleep(1000);
     SplashForm.Hide();
     Show();
     Activate();
 }
        public LeagueManager()
        {
            dbEngine = new DBEngine();
            Form frm = new SplashForm();

            Cursor = Cursors.WaitCursor;

            frm.Show();
            frm.Update();

            System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch() ;

            watch.Start();
            league = dbEngine.LoadLeague3(1);
            watch.Stop();

            MessageBox.Show(watch.Elapsed.ToString());

            InitializeComponent();

            frm.Hide();
            Cursor = Cursors.Default;

            //InitializeComponent();

            DockPanel dockPanel = new DockPanel();
            dockPanel.Dock = DockStyle.Fill;
            dockPanel.BackColor = Color.Beige;
            Controls.Add(dockPanel);
            dockPanel.BringToFront();

            leagueForm = new LeagueListForm();
            leagueForm.ShowHint = DockState.Document;
            leagueForm.Show(dockPanel);

            playerForm = new PlayerListForm();
            playerForm.ShowHint = DockState.Document;
            playerForm.Show(dockPanel);

            teamForm = new TeamListForm();
            teamForm.ShowHint = DockState.Document;
            teamForm.Show(dockPanel);
        }
        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;
        }
        private static void Main(string[] args)
        {
#if !DEBUG
            try
            {
#endif

            Application.ApplicationExit += (s, e) => Properties.Settings.Default.Save();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Environment.CurrentDirectory = ApplicationDirectory;

            Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentCulture;
            Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("fr"); //forces french translations to be used

            //Don't start application if arguments/files were being handled (except --open)
            if (HandleArguments(args))
            {
                return;
            }

            //Check if application is running already
            if (!Mutex.WaitOne(TimeSpan.Zero, true))
            {
                //Send broadcast to show the window of the current instance.
                NativeMethods.PostMessage((IntPtr)NativeMethods.HWND_BROADCAST, NativeMethods.WM_SHOWME, IntPtr.Zero, IntPtr.Zero);
                return;
            }

            #region Splash Screen Code

            using (var splash = new SplashForm())
            {
                splash.Show();

                splash.SetStatus(Properties.Strings.Splash_Folders);
                splash.statusBar.Value = 20;

                CreateFolders();

                splash.SetStatus(Properties.Strings.Splash_DetectOS);
                _ = OperatingSystemVersions.CurrentVersion;
                splash.statusBar.Value = 40;

                splash.SetStatus(Properties.Strings.Splash_Extensions);
                Loader.LoadExtensions();
                splash.statusBar.Value = 60;

                splash.SetStatus(Properties.Strings.Splash_Backups);
                LoadBackups();
                splash.statusBar.Value = 80;

                splash.SetStatus(Properties.Strings.Splash_Pages);
                InitializePages();
                splash.statusBar.Value = 100;

#if DEBUG
                splash.SetStatus(Properties.Strings.Splash_Debug);
                Pages.Add(new DebugPage());
#endif

                splash.Hide();
            }

            #endregion Splash Screen Code
            using (var main = new MainForm())
            {
                System.Media.SoundPlayer player = new System.Media.SoundPlayer(Properties.Resources.test); //this loads in the startup sound
                player.Play();                                                                             //it plays said sound

                Application.Run(main);
            }

#if !DEBUG
        }

        catch (Exception ex)
        {
            SendCrashReport(ex);
            throw;
        }
#endif
        }
        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;
        }
Beispiel #6
0
        private static void Main(string[] args)
        {
#if !DEBUG
            try
            {
#endif

            Application.ApplicationExit += (s, e) => Properties.Settings.Default.Save();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Environment.CurrentDirectory = ApplicationDirectory;

            Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentCulture;
            //Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("fr");

            //Don't start application if arguments/files were being handled (except --open)
            if (HandleArguments(args))
            {
                return;
            }

            //Check if application is running already
            if (!Mutex.WaitOne(TimeSpan.Zero, true))
            {
                //Send broadcast to show the window of the current instance.
                NativeMethods.PostMessage((IntPtr)NativeMethods.HWND_BROADCAST, NativeMethods.WM_SHOWME, IntPtr.Zero, IntPtr.Zero);
                return;
            }

            using (var splash = new SplashForm())
            {
                splash.Show();

                splash.SetStatus("Creating folders...");
                CreateFolders();

                splash.SetStatus("Retrieving OS Version...");
                _ = OperatingSystemVersions.CurrentVersion;

                splash.SetStatus("Loading extensions...");
                Loader.LoadExtensions();

                splash.SetStatus("Loading backups...");
                LoadBackups();

                splash.SetStatus("Initializing pages...");
                InitializePages();

#if DEBUG
                splash.SetStatus("Unlocking debug page...");
                Pages.Add(new DebugPage());
#endif

                splash.Hide();
            }

            using (var main = new MainForm())
            {
                Application.Run(main);
            }

#if !DEBUG
        }

        catch (Exception ex)
        {
            SendCrashReport(ex);
            throw;
        }
#endif
        }
Beispiel #7
0
        static void Main()
        {
            if (Environment.OSVersion.Version.Major >= 6)
            {
                SetProcessDPIAware();
            }

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            XDocument xdoc = null;

            try
            {
                xdoc = XDocument.Load("http://13.230.62.42/quras/update/update.xml");
            }
            catch { }
            if (xdoc != null)
            {
                Version version = Assembly.GetExecutingAssembly().GetName().Version;
                Version minimum = Version.Parse(xdoc.Element("update").Attribute("minimum").Value);
                if (version < minimum)
                {
                    using (UpdateWindow dialog = new UpdateWindow(xdoc))
                    {
                        dialog.ShowDialog();
                        if (dialog.DialogResult != DialogResult.Cancel)
                        {
                            return;
                        }
                    }
                }
            }
            SplashForm splash = new SplashForm();

            splash.Show();
            Application.DoEvents();
            int zkSnarksKeyStatus = Global.Utils.CheckZKSnarksKeyStatus();

            splash.Hide();
            if (zkSnarksKeyStatus != 0)
            {
                using (DownloadKeyForm dialog = new DownloadKeyForm(zkSnarksKeyStatus))
                {
                    dialog.ShowDialog();
                    if (dialog.DialogResult == DialogResult.Cancel)
                    {
                        return;
                    }
                }
            }

            Form startForm;

            startForm = new WelcomeForm();

            /*
             * if (Settings.Default.LastWalletPath.Length == 0)
             * {
             *  startForm = new WelcomeForm();
             * }
             * else
             * {
             *  startForm = new RestoreWalletForm();
             * }
             */
            FormManager.GetInstance().Push(startForm);

            if (File.Exists(Constant.PEER_STATE_PATH))
            {
                using (FileStream fs = new FileStream(Constant.PEER_STATE_PATH, FileMode.Open, FileAccess.Read, FileShare.Read))
                {
                    LocalNode.LoadState(fs);
                }
            }
            using (Blockchain.RegisterBlockchain(new LevelDBBlockchain("chain")))
                using (Constant.LocalNode = new LocalNode())
                {
                    Constant.LocalNode.UpnpEnabled = true;
                    Application.Run(startForm);
                }
            using (FileStream fs = new FileStream(Constant.PEER_STATE_PATH, FileMode.Create, FileAccess.Write, FileShare.None))
            {
                LocalNode.SaveState(fs);
            }
        }