Exemple #1
0
        public void SetData(WorkspaceData data, WorkspaceData savedData)
        {
            if (Equals(Data, data) && Equals(SavedData, savedData))
            {
                return;
            }
            var workspaceChange = new WorkspaceChangeArgs(Data, SavedData);

            _data = data;
            _savedWorkspaceData = savedData;
            _tracerDefList      = null;
            RetentionTimeAlignments.SetData(Data);
            Settings.Update(workspaceChange);
            Modifications.Update(workspaceChange);
            TracerDefs.Update(workspaceChange);
            Peptides.Update(workspaceChange);
            MsDataFiles.Update(workspaceChange);
            PeptideAnalyses.Update(workspaceChange);
            var changeHandlers = Change;

            if (null != changeHandlers)
            {
                changeHandlers(this, workspaceChange);
            }
        }
Exemple #2
0
 private Workspace()
 {
     _data                   = _savedWorkspaceData = new WorkspaceData();
     Modifications           = new Modifications(this);
     Settings                = new WorkspaceSettings(this);
     TracerDefs              = new TracerDefs(this);
     PeptideAnalyses         = new PeptideAnalyses(this);
     Peptides                = new Peptides(this);
     MsDataFiles             = new MsDataFiles(this);
     RetentionTimeAlignments = new RetentionTimeAlignments(Data);
 }
Exemple #3
0
 public Workspace(Workspace workspace) : this()
 {
     _owner                  = workspace._owner;
     InstanceId              = workspace.InstanceId;
     DatabasePath            = workspace.DatabasePath;
     DatabaseLock            = workspace.DatabaseLock;
     _tpgLinkDef             = workspace.TpgLinkDef;
     _data                   = workspace._data;
     _savedWorkspaceData     = workspace._savedWorkspaceData;
     RetentionTimeAlignments = new RetentionTimeAlignments(Data);
     RetentionTimeAlignments.MergeFrom(workspace.RetentionTimeAlignments);
 }
 public void MergeFrom(RetentionTimeAlignments retentionTimeAlignments)
 {
     var newAlignments = new List<KeyValuePair<AlignmentKey, RetentionTimeAlignment>>();
     foreach (var pair in retentionTimeAlignments._alignments)
     {
         if (_alignments.ContainsKey(pair.Key))
         {
             continue;
         }
         if (Equals(GetRetentionTimes(pair.Key.FromId), retentionTimeAlignments.GetRetentionTimes(pair.Key.FromId))
             && Equals(GetRetentionTimes(pair.Key.ToId), retentionTimeAlignments.GetRetentionTimes(pair.Key.ToId)))
         {
             newAlignments.Add(pair);
         }
     }
     if (newAlignments.Count == 0)
     {
         return;
     }
     _alignments = ImmutableSortedList.FromValues(_alignments.Concat(newAlignments));
 }
Exemple #5
0
        public void MergeFrom(RetentionTimeAlignments retentionTimeAlignments)
        {
            var newAlignments = new List <KeyValuePair <AlignmentKey, RetentionTimeAlignment> >();

            foreach (var pair in retentionTimeAlignments._alignments)
            {
                if (_alignments.ContainsKey(pair.Key))
                {
                    continue;
                }
                if (Equals(GetRetentionTimes(pair.Key.FromId), retentionTimeAlignments.GetRetentionTimes(pair.Key.FromId)) &&
                    Equals(GetRetentionTimes(pair.Key.ToId), retentionTimeAlignments.GetRetentionTimes(pair.Key.ToId)))
                {
                    newAlignments.Add(pair);
                }
            }
            if (newAlignments.Count == 0)
            {
                return;
            }
            _alignments = ImmutableSortedList.FromValues(_alignments.Concat(newAlignments));
        }