void CheckFileRename(object sender, FileEventArgs e) { bool somethingChanged = false; foreach (Task curTask in tasks) { if (curTask.FileName == e.SourceFile) { curTask.FileName = e.TargetFile; somethingChanged = true; } } if (somethingChanged) { NotifyTaskChange(); } }
void CheckFileRemove(object sender, FileEventArgs e) { bool somethingChanged = false; for (int i = 0; i < tasks.Count; ++i) { Task curTask = (Task)tasks[i]; if (curTask.FileName == e.FileName) { tasks.RemoveAt(i); --i; somethingChanged = true; } } if (somethingChanged) { NotifyTaskChange(); } }