예제 #1
0
        /// <summary>
        /// <see cref="editTaskToolStripButton.Click"/> event handler. Opens a new <see cref="TaskForm"/> and updates the selected task in the configuration.
        /// </summary>
        private void EditTaskToolStripButton_Click(object sender, EventArgs e)
        {
            string   guid     = (string)taskListView.SelectedItems[0].Tag;
            TaskForm editForm = new TaskForm(Config.Tasks[guid]);

            if (editForm.ShowDialog() == DialogResult.OK)
            {
                Config.Tasks[guid] = editForm.ResultTask;
                SaveConfig();
                RedrawTasks();
            }
        }
예제 #2
0
        /// <summary>
        /// <see cref="newTaskToolStripButton.Click"/> event handler. Opens a new <see cref="TaskForm"/> and inserts the new task into the configuration.
        /// </summary>
        private void NewTaskToolStripButton_Click(object sender, EventArgs e)
        {
            TaskForm newForm = new TaskForm();

            if (newForm.ShowDialog() == DialogResult.OK)
            {
                Task t = newForm.ResultTask;
                Config.Tasks[t.Guid] = t;
                SaveConfig();
                RedrawTasks();
            }
        }