Exemple #1
0
 public bool Remove(Task task)
 {
     try
     {
         Tasks.Remove(task);
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
Exemple #2
0
 private bool DeleteTask(Task task)
 {
     if (task.Name.Equals(comboBox1.Items[0]))
         //throw new NotSupportedException(); //TODO
         return false;
     TransferTaskTime(task);
     return _taskList.Remove(task);
 }
Exemple #3
0
        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);
        }
Exemple #4
0
 private static void TransferTaskTime(Task srcTask, Task dstTask)
 {
     dstTask.AddSeconds(srcTask.DurationInSeconds());
 }
Exemple #5
0
 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));
 }
Exemple #6
0
 public bool Equals(Task other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.Name, Name);
 }