private void btnReMerge_Click(object sender, EventArgs e) { saveFileDialog1.FileName = folderBrowserDialog1.SelectedPath + "\\MergeResult_FullList.csv"; saveFileDialog1.Filter = "CSV Files (*.csv)|*.csv"; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { List <string> files = new List <string>(); foreach (string file in lstMergeFileToProcess.Items) { files.Add(MergeResultfiles[file]); } MergeQuantitationResults.MergeFullList(files, saveFileDialog1.FileName); files.Clear(); foreach (string file in lstMergeFileToProcess.Items) { files.Add(MergeResultfiles[file].Replace("_FullList.csv", ".csv")); } MergeQuantitationResults.MergeConservedList(files, saveFileDialog1.FileName.Replace("_FullList.csv", ".csv")); MessageBox.Show("Merge Complete"); } }
private void bgWorker_Process_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { while (bgWorker_Process.IsBusy) { Thread.Sleep(1000); } lblCurrentFile.Text = ProcessedFileCount.ToString() + " / " + _RawFilesList.Count.ToString(); lblFileName1.Text = "FileName:"; lblStatus1.Text = "Status: Ready"; progressBar1.Value = 0; lblPercentage1.Text = "0%"; lblFileName2.Text = "FileName:"; lblStatus2.Text = "Status: Ready"; progressBar2.Value = 0; lblPercentage2.Text = "0%"; lblFileName3.Text = "FileName:"; lblStatus3.Text = "Status: Ready"; progressBar3.Value = 0; lblPercentage3.Text = "0%"; //MessageBox.Show("Finish jobs; Start merge"); #region Export Merge result //Fetch Files List <string> ResultFilesFull = new List <string>(); List <string> AllGlycans = new List <string>(); foreach (string filename in _RawFilesList) { if (!Directory.Exists(_MultiNGlycan.ExportFilePath + "\\" + Path.GetFileNameWithoutExtension(filename))) { continue; } foreach ( string files in Directory.GetFiles(_MultiNGlycan.ExportFilePath + "\\" + Path.GetFileNameWithoutExtension(filename))) { if (files.EndsWith(".csv") && files.Contains("_FullLis") && !files.Contains("_Quant")) { ResultFilesFull.Add(files); } } } MergeQuantitationResults.MergeFullList(ResultFilesFull, _MultiNGlycan.ExportFilePath + "\\MergeResult_FullList.csv"); List <string> ResultFile = new List <string>(); foreach (string str in ResultFilesFull) { ResultFile.Add(str.Replace("_FullList.csv", ".csv")); } MergeQuantitationResults.MergeConservedList(ResultFile, _MultiNGlycan.ExportFilePath + "\\MergeResult.csv"); #endregion MessageBox.Show("Finished files:" + SucceedFileCount.ToString() + Environment.NewLine + ErrMsg); this.Close(); }