private void convertInfinityChessDatabaseicdToPGNToolStripMenuItem_Click(object sender, EventArgs e) { fileName = txtFile.Text; if (fileName.EndsWith(Files.DatabaseExtension)) { Icd = new IcdManager(this.Game); Icd.OnProgressBarInitialized += new IcdManager.ProgressBarInitHandler(Icd_OnProgressBarInitialized); Icd.OnProgressChanged += new IcdManager.ProgressChangedEventHandler(Icd_OnProgressChanged); Icd.OnProgressWorkCompleted += new IcdManager.ProgressWorkCompletedHandler(Icd_OnProgressWorkCompleted); UFile.Delete(fileName.Replace(".icd", ".pgn")); Icd.ConvertIcdToPgn(fileName); } else { MessageForm.Error(Msg.GetMsg(MsgE.ErrorInvalidFileFormat)); return; } }
private void convertPGNToInfinityChessDatabaseicdToolStripMenuItem_Click(object sender, EventArgs e) { pgn = new PgnManager(this.Game); pgn.OnProgressBarInitialized += new PgnManager.ProgressBarInitHandler(pgn_OnProgressBarInitialized); pgn.OnProgressChanged += new PgnManager.ProgressChangedEventHandler(pgn_OnProgressChanged); pgn.OnProgressWorkCompleted += new PgnManager.ProgressWorkCompletedHandler(pgn_OnProgressWorkCompleted); fileName = txtFile.Text; if (isPgnToIcbConversion) { pgn.isPgnToIcbConversion = true; UFile.Delete(fileName.Replace(".pgn", ".icb")); } else { UFile.Delete(fileName.Replace(".pgn", ".icd")); } pgn.ConvertPgnToIcd(fileName); isPgnToIcbConversion = false; }