Пример #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();
                  }
              }

              }
        }
Пример #2
0
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            base.OnFormClosing(e);

            if (e.CloseReason == CloseReason.WindowsShutDown || e.CloseReason == CloseReason.ApplicationExitCall || e.CloseReason == CloseReason.TaskManagerClosing)
                return;

            if (UserSettings.MinimiseToTray)
            {
                this.Hide();

                WOTTrayApp trayApp = new WOTTrayApp();
                trayApp.Show();
            }
            else
            {
                Application.Exit();
            }
        }
Пример #3
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();
        }