private void openFile(OpenDataSourceDialog.MSDataRunPath filepath) { // update recent files list recentFilesMenu.AddFile(filepath.ToString(), filepath.ToString().Split('\\').Last()); recentFilesMenu.SaveToRegistry(); Manager.OpenFile(filepath.ToString(), closeIfOpen: true); }
public SpectrumSource(OpenDataSourceDialog.MSDataRunPath filepath) { if (!File.Exists(filepath.Filepath) && !Directory.Exists(filepath.Filepath)) // Some mass spec "files" are really directory structures { throw new FileNotFoundException("Filepath not found: " + filepath, filepath.Filepath); } MSDataFile = new MSData(); ReaderList.FullReaderList.read(filepath.Filepath, MSDataFile, filepath.RunIndex, GetReaderConfig()); sourceFilepath = filepath.ToString(); // create dummy spectrum/chromatogram list to simplify logic MSDataFile.run.spectrumList = MSDataFile.run.spectrumList ?? new SpectrumListSimple(); MSDataFile.run.chromatogramList = MSDataFile.run.chromatogramList ?? new ChromatogramListSimple(); setInputFileWaitHandle = new EventWaitHandle(false, EventResetMode.ManualReset); /*setInputFileDelegate = new ParameterizedThreadStart( startSetInputFile ); * Thread setInputFileThread = new Thread( setInputFileDelegate ); * * setInputFileThread.Start( (object) filepath );*/ }