private void AddAFile(string filePath) { string filename = Path.GetFileName(filePath); string theExtension = Path.GetExtension(filename).ToLowerInvariant(); switch (theExtension) { case ".raw": if (!ThermoStaticData.CheckForMsFileReader()) { AddNotification("Warning! Cannot find Thermo MSFileReader (v3.0 SP2 is preferred); a crash may result from searching this .raw file"); } goto case ".mzml"; case ".mzml": SpectraFileForDataGrid spectraFile = new SpectraFileForDataGrid(filePath); if (!spectraFilesForDataGrid.Select(f => f.FilePath).Contains(spectraFile.FilePath)) { spectraFilesForDataGrid.Add(spectraFile); } if (string.IsNullOrEmpty(OutputFolderTextBox.Text)) { var pathOfFirstSpectraFile = Path.GetDirectoryName(spectraFilesForDataGrid.First().FilePath); OutputFolderTextBox.Text = Path.Combine(pathOfFirstSpectraFile, @"FlashLFQ_$DATETIME"); } break; case ".txt": case ".tsv": case ".psmtsv": case ".tabular": IdentificationFileForDataGrid identFile = new IdentificationFileForDataGrid(filePath); if (!identFilesForDataGrid.Select(f => f.FilePath).Contains(identFile.FilePath) && !identFile.FileName.Equals("ExperimentalDesign.tsv")) { identFilesForDataGrid.Add(identFile); } break; default: AddNotification("Unrecognized file type: " + theExtension); break; } }
public static void ThermoReaderNotInstalled() { bool check = ThermoStaticData.CheckForMsFileReader(); Assert.IsTrue(check); }