/// <summary> /// Function of add a new task /// </summary> /// <param name="day">Target day</param> private void BtnAddTask(Day day) { TaskWindow window = new TaskWindow(); window.Owner = this; DataTask newTask = new DataTask("New Task", string.Empty, 0, 0); /// To open the window of add new task if (window.ShowDialog(newTask, () => AddTask(newTask, day)) == true) { } }
/// <summary> /// Open the window of task edit /// </summary> /// <param name="task">Target task</param> public void OnEditTask(Task task) { TaskWindow window = new TaskWindow(); window.Owner = this; if (window.ShowDialog(task.DataTask, null) == true) { } if (currentTask == task) { UpdateInterfaceSelectedTask(); } dataChanged = true; }