/// <summary> /// Download all missing img/nfo /// </summary> /// <param name="sender">sender</param> /// <param name="e">EventArgs</param> private void BtnMAJ_Img_NFO_Click(object sender, EventArgs e) { MAJ_Img_Nfo maj = new MAJ_Img_Nfo(); maj.Show(); maj.StartDownloadAllMissingFiles(); }
/// <summary> /// Update image nfo of the selected rom /// </summary> /// <param name="sender">sender</param> /// <param name="e">EventArgs</param> private void DonwloadOneRomImage_Click(object sender, EventArgs e) { MAJ_Img_Nfo maj = new MAJ_Img_Nfo(); maj.FormClosed += new FormClosedEventHandler(Maj_FormClosed); maj.SetShowFinishMessage(false); int releaseNumber = int.Parse(_controler.GetCurrentRom().ReleaseNumber); string filePath = string.Format("{0}{1}.png", Parameter.Config.Paths.DirImage, releaseNumber.ToString("0000")); Queue <MajUrl> liste = new Queue <MajUrl>(); if (!File.Exists(filePath)) { liste.Enqueue(new MajUrl() { Uri = Directories.GetUriFor(releaseNumber, DirectoriesEnum.UrlIco), Filepath = filePath }); } filePath = string.Format("{0}{1}a.png", Parameter.Config.Paths.DirImage, releaseNumber.ToString("0000")); if (!File.Exists(filePath)) { liste.Enqueue(new MajUrl() { Uri = Directories.GetUriFor(releaseNumber, DirectoriesEnum.UrlCover), Filepath = filePath }); } filePath = string.Format("{0}{1}b.png", Parameter.Config.Paths.DirImage, releaseNumber.ToString("0000")); if (!File.Exists(filePath)) { liste.Enqueue(new MajUrl() { Uri = Directories.GetUriFor(releaseNumber, DirectoriesEnum.UrlInGame), Filepath = filePath }); } filePath = string.Format("{0}{1}.nfo", Parameter.Config.Paths.DirNFO, releaseNumber.ToString("0000")); if (!File.Exists(filePath)) { liste.Enqueue(new MajUrl() { Uri = Directories.GetUriFor(releaseNumber, DirectoriesEnum.UrlNfo), Filepath = filePath }); } maj.Bw_RunWorkerCompleted(null, new RunWorkerCompletedEventArgs(liste, null, false)); maj.Show(); }
/// <summary> /// Worker diff work completed /// </summary> /// <param name="sender">sender</param> /// <param name="e">RunWorkerCompletedEventArgs</param> private void Bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { File.Delete(Directory.GetParent(Parameter.Config.Paths.XmlDataBase) + "\\ADVANsCEne_NDScrc.xml.old"); File.Delete(string.Format("{0}\\ADVANsCEne_NDScrc_Version.txt", Application.StartupPath)); this.Text = string.Format("NdsCRC III v{0} - AdvanceSceneDat v{1} ({2})", ProductVersion, _controler.DatVersion, _controler.DatCreationDate); _controler.ReloadAdvanSceneDataBase(); MAJ_Img_Nfo maj = new MAJ_Img_Nfo(); maj.Show(); maj.StartDownloadAllMissingFiles(); MessageBox.Show(Parameter.Lang.GetTranslate("DataBaseUpdateComplete"), Parameter.Lang.GetTranslate("DataBaseUpdateCompletePopupTitle"), MessageBoxButtons.OK, MessageBoxIcon.Information); tabControl1.SelectedIndex = 4; }