private void WrkChkApp_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { try { // Проверим статус проверки... if (e.Error == null) { // Проверим наличие обновлений для приложения... if (UpMan.CheckAppUpdate()) { UpdAppImg.Image = Properties.Resources.upd_av; UpdAppStatus.Text = String.Format(AppStrings.UPD_AppUpdateAvail, UpMan.AppUpdateVersion); } else { UpdAppImg.Image = Properties.Resources.upd_nx; UpdAppStatus.Text = AppStrings.UPD_AppNoUpdates; UpdateTimeSetApp(); } // Проверим наличие обновлений для базы игр... if (UpMan.CheckGameDBUpdate()) { UpdDBImg.Image = Properties.Resources.upd_av; UpdDBStatus.Text = String.Format(AppStrings.UPD_DbUpdateAvail, UpMan.GameUpdateHash.Substring(0, 7)); } else { UpdDBImg.Image = Properties.Resources.upd_nx; UpdDBStatus.Text = AppStrings.UPD_DbNoUpdates; } // Проверим наличие обновлений для базы HUD... if (UpMan.CheckHUDUpdate()) { UpdHUDDbImg.Image = Properties.Resources.upd_av; UpdHUDStatus.Text = String.Format(AppStrings.UPD_HUDUpdateAvail, UpMan.HUDUpdateHash.Substring(0, 7)); } else { UpdHUDDbImg.Image = Properties.Resources.upd_nx; UpdHUDStatus.Text = AppStrings.UPD_HUDNoUpdates; UpdateTimeSetHUD(); } } else { // Произошла ошибка... UpdAppImg.Image = Properties.Resources.upd_err; UpdAppStatus.Text = AppStrings.UPD_AppCheckFailure; UpdDBImg.Image = Properties.Resources.upd_err; UpdDBStatus.Text = AppStrings.UPD_DbCheckFailure; UpdHUDDbImg.Image = Properties.Resources.upd_err; UpdHUDStatus.Text = AppStrings.UPD_HUDCheckFailure; // Запишем в журнал... CoreLib.WriteStringToLog(e.Error.Message); } } catch (Exception Ex) { CoreLib.WriteStringToLog(Ex.Message); } }
private void UpdDBStatus_Click(object sender, EventArgs e) { if (!WrkChkApp.IsBusy) { if (UpMan.CheckGameDBUpdate()) { InstallDatabaseUpdate(Properties.Resources.GameListFile, UpMan.GameUpdateURL, UpMan.GameUpdateHash); } else { MessageBox.Show(AppStrings.UPD_LatestDBInstalled, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show(AppStrings.DB_WrkInProgress, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); } }