Beispiel #1
0
 private void MiLoadTasks_Click(object sender, RoutedEventArgs e)
 {
     if (openFileDialog.ShowDialog() == true)
     {
         SeriesCollection = new SeriesCollection();
         try
         {
             Tasks = worker.LoadTasksFromJson(openFileDialog.FileName);
         }
         catch (Exception ex)
         {
             ShowErrorMessage(ex.Message);
         }
         foreach (Task t in Tasks)
         {
             t.PropertyChanged += Task_PropertyChanged;
             if (!Responsibles.Contains(t.Responsible))
             {
                 t.Responsible = new Responsible(-1, "Unknown");
             }
         }
         Tasks.CollectionChanged += new NotifyCollectionChangedEventHandler(TasksCollectionChanged);
         lbTasks.ItemsSource      = Tasks;
         //Chart
         UpdateChart();
     }
 }
Beispiel #2
0
 private void UpdateEndDate()
 {
     if (dpStartDate.SelectedDate != null && dpStartDate.SelectedDate.Value != DateTime.MinValue &&
         cbResponsible.SelectedItem is Responsible && Responsibles.Contains(cbResponsible.SelectedItem as Responsible) &&
         tbDuration.Text != string.Empty && double.TryParse(tbDuration.Text, out double duration) && duration >= 0)
     {
         dpEndDate.SelectedDate = CalendarManager.GetTaskEndTime(
             dpStartDate.SelectedDate.Value,
             CalendarManager.GetDaysQuantity(
                 (cbResponsible.SelectedItem as Responsible).HoursPerDay, duration));
     }
 }