private void Tree_TreeStructureChanged(MapNode node, TreeStructureChangedEventArgs e) { if (e.ChangeType == TreeStructureChange.Deleted || e.ChangeType == TreeStructureChange.Detached) { node.ForEach(n => { if (n.IsTaskComplete()) { Remove(n); var evtTask = new CompletedTaskEventArgs(); evtTask.TaskChange = CompletedTaskChange.TaskRemoved; if (n.CompletionDateExists()) { evtTask.OldCompletionDate = n.GetCompletionDate(); } evtTask.OldTaskStatus = n.GetTaskStatus(); TaskChanged(n, evtTask); } }); } else if (e.ChangeType == TreeStructureChange.Attached) { node.ForEach((n) => { if (n.IsTaskComplete()) { Add(n); var evtTask = new CompletedTaskEventArgs(); evtTask.TaskChange = CompletedTaskChange.TaskCompleted; if (n.CompletionDateExists()) { evtTask.OldCompletionDate = n.GetCompletionDate(); } evtTask.OldTaskStatus = n.GetTaskStatus(); TaskChanged(n, evtTask); } }); } }
public CompletedTaskList() : base(n => n.GetCompletionDate()) { completedTaskArgs = new CompletedTaskEventArgs(); }
private void Tree_TreeStructureChanged(MapNode node, TreeStructureChangedEventArgs e) { if (e.ChangeType == TreeStructureChange.Deleted || e.ChangeType == TreeStructureChange.Detached) { node.ForEach(n => { if (n.IsTaskComplete()) { Remove(n); var evtTask = new CompletedTaskEventArgs(); evtTask.TaskChange = CompletedTaskChange.TaskRemoved; if (n.CompletionDateExists()) evtTask.OldCompletionDate = n.GetCompletionDate(); evtTask.OldTaskStatus = n.GetTaskStatus(); TaskChanged(n, evtTask); } }); } else if (e.ChangeType == TreeStructureChange.Attached) { node.ForEach((n) => { if (n.IsTaskComplete()) { Add(n); var evtTask = new CompletedTaskEventArgs(); evtTask.TaskChange = CompletedTaskChange.TaskCompleted; if (n.CompletionDateExists()) evtTask.OldCompletionDate = n.GetCompletionDate(); evtTask.OldTaskStatus = n.GetTaskStatus(); TaskChanged(n, evtTask); } }); } }