예제 #1
0
        public override bool TryGetRetentionTimes(MsDataFileUri filePath, out LibraryRetentionTimes retentionTimes)
        {
            int j = _librarySourceFiles.IndexOf(info => Equals(filePath.ToString(), info.FilePath));

            if (j != -1)
            {
                var source = _librarySourceFiles[j];
                ILookup <Target, double[]> timesLookup = _libraryEntries.ToLookup(
                    entry => entry.Key.Target,
                    entry => entry.RetentionTimesByFileId.GetTimes(source.Id));
                var timesDict = timesLookup.ToDictionary(
                    grouping => grouping.Key,
                    grouping =>
                {
                    var array = grouping.SelectMany(values => values).ToArray();
                    Array.Sort(array);
                    return(array);
                });
                var nonEmptyTimesDict = timesDict
                                        .Where(kvp => kvp.Value.Length > 0)
                                        .ToDictionary(kvp => kvp.Key, kvp => new Tuple <TimeSource, double[]>(TimeSource.peak, kvp.Value));

                retentionTimes = new LibraryRetentionTimes(filePath.ToString(), nonEmptyTimesDict);
                return(true);
            }

            return(base.TryGetRetentionTimes(filePath, out retentionTimes));
        }
예제 #2
0
        public override bool TryGetRetentionTimes(LibKey key, MsDataFileUri filePath, out double[] retentionTimes)
        {
            int i = FindEntry(key);
            int j = _librarySourceFiles.IndexOf(info => Equals(filePath.ToString(), info.FilePath));

            if (i != -1 && j != -1)
            {
                retentionTimes = _libraryEntries[i].RetentionTimesByFileId.GetTimes(_librarySourceFiles[j].Id);
                return(true);
            }

            return(base.TryGetRetentionTimes(key, filePath, out retentionTimes));
        }
예제 #3
0
 public override bool TryGetRetentionTimes(MsDataFileUri filePath, out LibraryRetentionTimes retentionTimes)
 {
     return(TryGetRetentionTimes(FindFileInList(filePath, _sourceFiles), filePath.ToString(), out retentionTimes));
 }