Ejemplo n.º 1
0
        private void frmController_Load(object sender, EventArgs e)
        {
            Visible = false;

              if (WOTHelper.FindProcess("WOT.Stats"))
              {
              DevExpress.XtraEditors.XtraMessageBox.Show("WOT Statistics is already running", "WOT Statistics", MessageBoxButtons.OK, MessageBoxIcon.Hand);
              this.Close();
              }
              else
              {
              if (UserSettings.MinimiseonStartup == true)
              {
                  WOTTrayApp sysTray = new WOTTrayApp();
                  sysTray.Show();
              }
              else
              {
                  using (frmMain wotGUI = new frmMain())
                  {
                      wotGUI.ShowDialog();
                  }
              }

              }
        }
Ejemplo n.º 2
0
        public void bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            _done = true;

            Thread.Sleep(1000);

            //###########
            //this.Close();
            //Close();
            //Application.Exit();
            //###########

            this.Hide();
            this.Close();
            if (UserSettings.MinimiseonStartup == true)
            {
                WOTTrayApp sysTray = new WOTTrayApp();
                sysTray.Show();
            }
            else
            {

                if (WOTStatistics.Core.UserSettings.AppVersion != WOTStatistics.Core.UserSettings.LastReleaseNotes)
                {

                try
                {

                    WOTStatistics.Core.UserSettings.LastReleaseNotes = WOTStatistics.Core.UserSettings.AppVersion;
                    string sVersion = "ReleaseNote_" + WOTStatistics.Core.UserSettings.AppVersion.Replace(".", string.Empty) + ".htm";
                    ReleaseNotes oRN = new ReleaseNotes();
                    oRN.LoadPage(Path.Combine(WOTStatistics.Core.WOTHelper.GetApplicationData(), sVersion));
                    oRN.ShowDialog();
                    oRN.BringToFront();

                }
                catch (Exception exrn)
                {
                    WOTHelper.AddToLog("Release Notes: " + exrn.Message);
                }

                }

                frmMain frm = new frmMain();
                WOTHelper.AddToLog("Starting Main Form...");
                frm.Show();
                WOTHelper.AddToLog("Starting Main Form DONE");
            }

            _workerThread.Dispose();
            this.Dispose();
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (_workerThread.IsBusy)
            {
                _cancel = true;
                _workerThread.CancelAsync();
            }
            else
            {

                this.Hide();
                this.Close();
                frmMain frm = new frmMain();
                frm.Show();
                _workerThread.Dispose();
                this.Dispose();
            }
        }