public bool Remove(Task task) { try { Tasks.Remove(task); return true; } catch (Exception) { return false; } }
private bool DeleteTask(Task task) { if (task.Name.Equals(comboBox1.Items[0])) //throw new NotSupportedException(); //TODO return false; TransferTaskTime(task); return _taskList.Remove(task); }
private void CorrectBookedTime(Task task) { var correctBookedTimeForm = new CorrectBookedTimeForm(task.DurationInMinutes(DateTime.Now)); if (correctBookedTimeForm.ShowDialog() != DialogResult.OK || correctBookedTimeForm.TimeCorrection == 0) return; task.AddMinutes(correctBookedTimeForm.TimeCorrection); Timer1Tick(null, null); }
private static void TransferTaskTime(Task srcTask, Task dstTask) { dstTask.AddSeconds(srcTask.DurationInSeconds()); }
private void TransferTaskTime(Task srcTask) { var transferTimeForm = new TransferTimeForm(GetTaskListAsStringList(), srcTask.Name, srcTask.DurationInMinutes()); if (transferTimeForm.ShowDialog() == DialogResult.Yes) TransferTaskTime(srcTask, _taskList.GetByName(transferTimeForm.DestinationTask)); }
public bool Equals(Task other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.Name, Name); }