private void newToDoTask(object sender, EventArgs e) { using (ToDoItemDialog dialog = new ToDoItemDialog(this._engine)) { if (dialog.ShowDialog() == DialogResult.OK) { if (dialog.ToDoTask != null && dialog.ToDoTask.TaskDescription != null) { _todoTasks.Add(dialog.ToDoTask); _engine.SettingsProvider.Set("ToDoTasks", _todoTasks, PersistHint.AcrossSessions); PopulateListView(); } } } }
private void editToDoTask(object sender, EventArgs e) { ToDoTask toDoTask = listView.Items[listView.SelectedIndices[0]].Tag as ToDoTask; using (ToDoItemDialog dialog = new ToDoItemDialog(this._engine, toDoTask)) { if (dialog.ShowDialog() == DialogResult.OK) { if (dialog.ToDoTask != null && dialog.ToDoTask.TaskDescription != null) { _todoTasks.Add(dialog.ToDoTask); _engine.SettingsProvider.Set("ToDoTasks", _todoTasks, PersistHint.AcrossSessions); PopulateListView(); } } } }