/// <summary> /// Updates the parameters for a list of named results. Including a check to see if any of the files /// are Waters files in potential need of lockmass correction. If lockmass correction is desired, /// the MsDataFileUri values in namedResults are modified. /// /// CONSIDER: Move this to a more general location, since it now does more than just lockmass correction. /// </summary> /// <param name="parent">Parent window to make owner of <see cref="ImportResultsLockMassDlg"/></param> /// <param name="doc">we only do lockmass correction if doc has full scan settings</param> /// <param name="namedResults">list of files to be checked - lockmass settings may be modified by this call</param> /// <returns>false iff cancelled by user</returns> public static bool UpdateNamedResultsParameters(Control parent, SrmDocument doc, ref List <KeyValuePair <string, MsDataFileUri[]> > namedResults) { LockMassParameters lockMassParameters = null; if (doc.Settings.TransitionSettings.FullScan.IsEnabled && namedResults.Any(n => n.Value.Any(m => m.IsWatersLockmassCorrectionCandidate()))) { // We have at least one Waters file possibly needing lockspray correction using (var dlgLockMass = new ImportResultsLockMassDlg()) { var result = dlgLockMass.ShowDialog(parent); if (result != DialogResult.OK) { return(false); // Cancelled } lockMassParameters = dlgLockMass.LockMassParameters; } } namedResults = ChangeLockMassParameters(namedResults, lockMassParameters, doc); return(true); // Success }
/// <summary> /// Updates the parameters for a list of named results. Including a check to see if any of the files /// are Waters files in potential need of lockmass correction. If lockmass correction is desired, /// the MsDataFileUri values in namedResults are modified. /// /// CONSIDER: Move this to a more general location, since it now does more than just lockmass correction. /// </summary> /// <param name="parent">Parent window to make owner of <see cref="ImportResultsLockMassDlg"/></param> /// <param name="doc">we only do lockmass correction if doc has full scan settings</param> /// <param name="namedResults">list of files to be checked - lockmass settings may be modified by this call</param> /// <returns>false iff cancelled by user</returns> public static bool UpdateNamedResultsParameters(Control parent, SrmDocument doc, ref List<KeyValuePair<string, MsDataFileUri[]>> namedResults) { LockMassParameters lockMassParameters = null; if (doc.Settings.TransitionSettings.FullScan.IsEnabled && namedResults.Any(n => n.Value.Any(m => m.IsWatersLockmassCorrectionCandidate()))) { // We have at least one Waters file possbily needing lockspray correction using (var dlgLockMass = new ImportResultsLockMassDlg()) { var result = dlgLockMass.ShowDialog(parent); if (result != DialogResult.OK) { return false; // Cancelled } lockMassParameters = dlgLockMass.LockMassParameters; } } namedResults = ChangeLockMassParameters(namedResults, lockMassParameters, doc); return true; // Success }