Exemple #1
0
        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);
                }
            }
            ;
        }
Exemple #2
0
        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);
            }
        }