public void InsertRun(DataRun existingRun, DataRun newRun) { int idx = DataRuns.IndexOf(existingRun); if (idx < 0) { throw new ArgumentException("Attempt to replace non-existant run", nameof(existingRun)); } DataRuns.Insert(idx + 1, newRun); }
public void ReplaceRun(DataRun oldRun, DataRun newRun) { int idx = DataRuns.IndexOf(oldRun); if (idx < 0) { throw new ArgumentException("Attempt to replace non-existant run", nameof(oldRun)); } DataRuns[idx] = newRun; }
public int RemoveRun(DataRun run) { int idx = DataRuns.IndexOf(run); if (idx < 0) { throw new ArgumentException("Attempt to remove non-existant run", nameof(run)); } DataRuns.RemoveAt(idx); return(idx); }