示例#1
0
        private void EditSelectedTask()
        {
            EditTask dialog = new EditTask();

            if (tasksListBox.SelectedItems.Count < 1)
            {
                return;
            }
            ListViewItem item = tasksListBox.SelectedItems[0];

            if (item == null)
            {
                return;
            }
            TaskTodo task = item.Tag as TaskTodo;

            dialog.LoadTask(task);
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                updateList(task);
                //updateTaskStatus(item, task);
                //tasksListBox.Refresh();
                Config.Tasks.SaveTasks();
            }
        }
示例#2
0
        private void AddTask()
        {
            EditTask dialog = new EditTask();
            TaskTodo task   = new TaskTodo("");

            dialog.LoadTask(task);
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                Config.Tasks.Add(task);
                updateTaskStatus(null, task);
                tasksListBox.Refresh();
                Config.Tasks.SaveTasks();
            }
        }