public void UpdateTaskCollections()
        {
            if (LoadedProject.Tasks != null)
            {
                ToDoTasks.Clear();
                InProgressTasks.Clear();
                CompletedTasks.Clear();

                foreach (ProjectTask task in LoadedProject.Tasks)
                {
                    switch (task.Stage)
                    {
                    case Stage.ToDo:
                        ToDoTasks.Add(task);
                        break;

                    case Stage.InProgress:
                        InProgressTasks.Add(task);
                        break;

                    case Stage.Completed:
                        CompletedTasks.Add(task);
                        break;

                    default:
                        break;
                    }
                }
            }
        }
Exemple #2
0
        public async System.Threading.Tasks.Task LoadDataAsync()
        {
            ToDoTasks.Clear();
            InProgressTasks.Clear();
            InReviewTasks.Clear();
            CompletedTasks.Clear();

            var tasks = await DataAccess.GetTasks(true);

            foreach (var task in tasks)
            {
                Tasks.Add(task);
                if (!task.SprintRelevant)
                {
                    continue;
                }

                switch (task.Status)
                {
                case Status.ToDo:
                    ToDoTasks.Add(task);
                    break;

                case Status.InProgress:
                    InProgressTasks.Add(task);
                    break;

                case Status.Review:
                    InReviewTasks.Add(task);
                    break;

                case Status.Completed:
                    CompletedTasks.Add(task);
                    break;
                }
            }

            ToDoTasks.CollectionChanged       += CollectionChanged;
            InProgressTasks.CollectionChanged += CollectionChanged;
            InReviewTasks.CollectionChanged   += CollectionChanged;
            CompletedTasks.CollectionChanged  += CollectionChanged;
        }
Exemple #3
0
 public void AddTask(ToDoTask task)
 {
     ToDoTasks.Add(task);
 }
 public IActionResult Post([FromBody] ToDoTask task)
 {
     _taskMngr.Add(task);
     return(Ok());
 }