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); } }
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); }
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)); }
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)); }