예제 #1
0
 void CheckConfig()
 {
     if (Common.Conf.LastStartedBuild < 57)
     {
         Common.Conf.LastStartedBuild = Common.DevelopersBuild;
         Common.Conf.Save();
         BkpMsg msg = new BkpMsg();
         BackUpSystem.DoBackup("Before_V57", msg);
         string[] dirs = Directory.GetDirectories(Common.Db.GetFoladerPath(""));
         foreach (string tmp in dirs)
         {
             UpdateSpectrs(tmp);
         }
         msg.Close();
     }
 }
예제 #2
0
        void ShowMainWindow()
        {
            Enabled = false;
            BkpMsg bmsg = new BkpMsg();

            try
            {
                Common.Log("Check bkp.");
                if (chbBackupSkip.Checked)
                {
                    Common.Log("Skipped by user....");
                }
                else
                {
                    BackUpSystem.DoBackupIfNeed(bmsg);
                }
            }
            catch (Exception ex)
            {
                Common.Log(ex);
            }
            finally
            {
                Enabled = true;
                bmsg.Close();
            }
            Common.Log("Loged as '" + Common.UserRole + "'");
            //MainForm mf = null;
            try
            {
                MF = new MainForm();

                /*Process p = Process.GetCurrentProcess();
                 * do
                 * {
                 *  Thread.Sleep(50);
                 * } while (p.MainWindowHandle == null);*/
                Common.SetupLogInfo();
            }
            catch (Exception ex)
            {
                Common.Log(ex);
            }
            try
            {
                //Control.CheckForIllegalCrossThreadCalls = false;
                Visible = false;

                /*Process p = Process.GetCurrentProcess();
                 * do
                 * {
                 *   Thread.Sleep(50);
                 * } while (p.MainWindowHandle == null);
                 * MF.ShowDialog();*/
                MF.ShowDialog();
                //Control.CheckForIllegalCrossThreadCalls = true;
            }
            catch (Exception ex)
            {
                Common.Log(ex);
                try
                {
                    MF.Close();
                }
                catch
                {
                }
            }
            try
            {
                Close();
            }
            catch (Exception ex)
            {
                Common.Log(ex);
            }
            Common.Stop();
        }