Exemplo n.º 1
0
 public void Start(bool systemWakeUp = false)
 {
     if (_config.firstRunOnNewVersion && !systemWakeUp)
     {
         ProgramUpdated.Invoke(this, new UpdatedEventArgs()
         {
             OldVersion = _config.version,
             NewVersion = UpdateChecker.Version,
         });
         // delete pac.txt when regeneratePacOnUpdate is true
         if (_config.regeneratePacOnUpdate)
         {
             try
             {
                 File.Delete(PACDaemon.PAC_FILE);
                 logger.Info("Deleted pac.txt from previous version.");
             }
             catch (Exception e)
             {
                 logger.LogUsefulException(e);
             }
         }
         // finish up first run of new version
         _config.firstRunOnNewVersion = false;
         _config.version = UpdateChecker.Version;
         Configuration.Save(_config);
     }
     Reload();
     if (!systemWakeUp)
     {
         HotkeyReg.RegAllHotkeys();
     }
 }
 public void Start(bool regHotkeys = true)
 {
     if (_config.updated && regHotkeys)
     {
         _config.updated = false;
         ProgramUpdated.Invoke(this, new UpdatedEventArgs()
         {
             OldVersion = _config.version,
             NewVersion = UpdateChecker.Version,
         });
         Configuration.Save(_config);
     }
     Reload();
 }