Ejemplo n.º 1
0
        public override IEnumerable <ReportOrViewSpec> GetDefaults(int revisionIndex)
        {
            List <ReportOrViewSpec> list = new List <ReportOrViewSpec>();

            list.AddRange(ReportSharing.DeserializeReportList(new MemoryStream(Encoding.UTF8.GetBytes(REPORTS_V1))));
            if (revisionIndex >= 2)
            {
                list.AddRange(ReportSharing.DeserializeReportList(new MemoryStream(Encoding.UTF8.GetBytes(REPORTS_V2))));
            }
            if (revisionIndex >= 3)
            {
                list.AddRange(ReportSharing.DeserializeReportList(new MemoryStream(Encoding.UTF8.GetBytes(REPORTS_V3))));
            }
            var nameMap = new Dictionary <string, string> {
                { "Peptide Ratio Results", Resources.ReportSpecList_GetDefaults_Peptide_Ratio_Results }, // Not L10N
                { "Peptide RT Results", Resources.ReportSpecList_GetDefaults_Peptide_RT_Results },       // Not L10N
                { "Transition Results", Resources.ReportSpecList_GetDefaults_Transition_Results },       // Not L10N
                { "Peak Boundaries", Resources.ReportSpecList_GetDefaults_Peak_Boundaries } // Not L10N
            };

            for (int i = 0; i < list.Count; i++)
            {
                string newName;
                if (nameMap.TryGetValue(list[i].Name, out newName))
                {
                    list[i] = list[i].ChangeName(newName);
                }
            }

            return(list);
        }
Ejemplo n.º 2
0
 protected ViewSpecList LoadViews(string filename)
 {
     using (var stream = File.OpenRead(filename))
     {
         var reportOrViewSpecs = ReportSharing.DeserializeReportList(stream);
         return(new ViewSpecList(ReportSharing.ConvertAll(reportOrViewSpecs, ((SkylineDataSchema)DataSchema).Document)));
     }
 }
Ejemplo n.º 3
0
        public ReportOrViewSpecList(ReportSpecList oldList)
        {
            RevisionIndex = oldList.RevisionIndex;
            var oldReports       = oldList.Select(item => new ReportOrViewSpec(item));
            var convertedReports = ReportSharing.ConvertAll(oldReports, new SrmDocument(SrmSettingsList.GetDefault()));

            AddRange(convertedReports.Select(view => new ReportOrViewSpec(view)));
            ValidateLoad();
        }
Ejemplo n.º 4
0
        public ReportOrViewSpecList(ReportSpecList oldList)
        {
            RevisionIndex = oldList.RevisionIndex;
            var oldReports       = oldList.Select(item => new ReportOrViewSpec(item));
            var convertedReports = ReportSharing.ConvertAll(oldReports, new SrmDocument(SrmSettingsList.GetDefault()));

            AddRange(convertedReports.Select(view => new ReportOrViewSpec(view)));
            // ReSharper disable once VirtualMemberCallInConstructor
            ValidateLoad();
        }
Ejemplo n.º 5
0
 protected override IList <ReportOrViewSpec> DeserializeItems(Stream stream)
 {
     return(ReportSharing.DeserializeReportList(stream));
 }