public void Finish() { // Now merge the lists. IList <Task> copy = new List <Task>(); for (int i = 0, n = list.Count; i < n; i++) { Task t = list[i]; copy.Add(t); } // Remove tasks that are no longer reported. foreach (Task t in copy) { if (!unique.Contains(t)) { this.list.Remove(t); } } // Remove any new tasks that have appeared. for (int i = 0, n = errors.Count; i < n; i++) { Task t = errors[i]; if (!list.Contains(t)) { this.list.Insert(i, t); } } }