Esempio n. 1
0
        private IEnumerable <Tuple <ElementRef, Annotations> > GetAllReplicateAnnotations()
        {
            var measuredResults = Document.MeasuredResults;

            if (measuredResults == null)
            {
                yield break;
            }
            foreach (var chromatogramSet in measuredResults.Chromatograms)
            {
                yield return(Tuple.Create((ElementRef)ReplicateRef.FromChromatogramSet(chromatogramSet), chromatogramSet.Annotations));
            }
        }
Esempio n. 2
0
        public SrmDocument SetReplicateAnnotations(SrmDocument document, ReplicateRef replicateRef,
                                                   Annotations annotations)
        {
            var measuredResults = document.MeasuredResults;

            if (measuredResults == null)
            {
                throw ElementNotFoundException(replicateRef);
            }
            for (int i = 0; i < measuredResults.Chromatograms.Count; i++)
            {
                var chromSet = measuredResults.Chromatograms[i];
                if (replicateRef.Matches(chromSet))
                {
                    chromSet = chromSet.ChangeAnnotations(annotations);
                    var newChromatograms = measuredResults.Chromatograms.ToArray();
                    newChromatograms[i] = chromSet;
                    return(document.ChangeMeasuredResults(measuredResults.ChangeChromatograms(newChromatograms)));
                }
            }
            throw ElementNotFoundException(replicateRef);
        }