private void UpdateOutputFolderTextbox() { if (StaticTasksObservableCollection.Count > 0) { OutputFolderTextBox.Text = StaticTasksObservableCollection.First().options.AnalysisDirectory; } else if (RnaSeqFastqCollection.Any()) { OutputFolderTextBox.Text = GetPathToFastqs(); } else { OutputFolderTextBox.Clear(); } }
private void UpdateOutputFolderTextbox() { if (RnaSeqFastqCollection.Any()) { var MatchingChars = from len in Enumerable.Range(0, RnaSeqFastqCollection.Select(b => b.FilePath).Min(s => s.Length)).Reverse() let possibleMatch = RnaSeqFastqCollection.Select(b => b.FilePath).First().Substring(0, len) where RnaSeqFastqCollection.Select(b => b.FilePath).All(f => f.StartsWith(possibleMatch, StringComparison.Ordinal)) select possibleMatch; OutputFolderTextBox.Text = Path.Combine(Path.GetDirectoryName(MatchingChars.First())); } else { OutputFolderTextBox.Clear(); } }
private void UpdateOutputFolderTextbox() { if (ProteinDbObservableCollection.Any()) { // if current output folder is blank and there is a database, use the file's path as the output path if (string.IsNullOrWhiteSpace(OutputFolderTextBox.Text)) { var pathOfFirstSpectraFile = System.IO.Path.GetDirectoryName(ProteinDbObservableCollection.First().FilePath); OutputFolderTextBox.Text = System.IO.Path.Combine(pathOfFirstSpectraFile, @"$DATETIME"); } // else do nothing (do not override if there is a path already there; might clear user-defined path) } else { // no spectra files; clear the output folder from the GUI OutputFolderTextBox.Clear(); } }
private void ClearSpectra_Click(object sender, RoutedEventArgs e) { spectraFilesForDataGrid.Clear(); OutputFolderTextBox.Clear(); }