void tasksListViewDoubleClick(object sender, MouseEventArgs e) { ListViewHitTestInfo hit = tasksListView.HitTest(e.Location); if (hit.Item != null) { Core.Task oldTask = (Core.Task)hit.Item.Tag; TaskEditForm form = new TaskEditForm(oldTask); form.ShowDialog(this); if (form.Result != null) { currentProject.RemoveTask(oldTask); currentProject.AddTask(form.Result); if (activeTask == oldTask) { SetActiveTask(form.Result); } RefreshTasks(); RefreshDaySummary(); ProjectsPersistenceManager.GetInstance().SaveAsyncOrShowError(projectGroup); } } ; }
void newButtonClick(object sender, EventArgs e) { TaskEditForm form = new TaskEditForm(null); form.ShowDialog(this); if (form.Result != null) { currentProject.AddTask(form.Result); RefreshTasks(); RefreshDaySummary(); ProjectsPersistenceManager.GetInstance().SaveAsyncOrShowError(projectGroup); } }