示例#1
0
 public void ConvertListData(List <ZTask> ZtaskList)
 {
     foreach (ZTask task in ZtaskList)
     {
         Ztasks.Add(task);
     }
 }
示例#2
0
 public async void OnOperationCompletion(List <ZTask> ZtaskList)
 {
     await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         Ztasks.Clear();
         foreach (ZTask task in ZtaskList)
         {
             Ztasks.Add(task);
         }
     });
 }
示例#3
0
        public async void OnTasksFetchedSuccessfully(List <ZTask> ZtaskList)
        {
            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                Ztasks.Clear();
                Display(ZtaskList);

                //Today.Clear();
                //Upcoming.Clear();
                //Delayed.Clear();
                //AssignedToOthers.Clear();
                //Home.Clear();
                //AddElementsToCollection(ZtaskList);
            });
        }
示例#4
0
 public void DisplayDelayedTasks()
 {
     Ztasks.Clear();
     ConvertListData(Delayed);
 }
示例#5
0
 public void DisplayUpcomingTasks()
 {
     Ztasks.Clear();
     ConvertListData(Upcoming);
 }
示例#6
0
 public void DisplayTasksAssignedToOthers()
 {
     Ztasks.Clear();
     ConvertListData(AssignedToOthers);
 }
示例#7
0
 public void DisplayTasksForToday()
 {
     Ztasks.Clear();
     ConvertListData(Today);
 }
示例#8
0
 public void DisplayMyTasks()
 {
     Ztasks.Clear();
     ConvertListData(Home);
 }
示例#9
0
        public void Sort(SortOperation sort)
        {
            List <ZTask> ZTaskList = Ztasks.ToList <ZTask>();

            Task.Run(() =>
            {
                switch (sort)
                {
                case SortOperation.DueDateAscending:
                    for (int i = 0; i < ZTaskList.Count; i++)
                    {
                        for (int j = i + 1; j < ZTaskList.Count; j++)
                        {
                            if (ZTaskList[i].TaskDetails.DueDate > ZTaskList[j].TaskDetails.DueDate || ZTaskList[i].TaskDetails.DueDate == null)
                            {
                                var tempTask = ZTaskList[i];
                                ZTaskList[i] = ZTaskList[j];
                                ZTaskList[j] = tempTask;
                            }
                        }
                    }
                    break;

                case SortOperation.DueDateDescending:
                    for (int i = 0; i < ZTaskList.Count; i++)
                    {
                        for (int j = i + 1; j < ZTaskList.Count; j++)
                        {
                            if (ZTaskList[i].TaskDetails.DueDate < ZTaskList[j].TaskDetails.DueDate || ZTaskList[i].TaskDetails.DueDate == null)
                            {
                                var tempTask = ZTaskList[i];
                                ZTaskList[i] = ZTaskList[j];
                                ZTaskList[j] = tempTask;
                            }
                        }
                    }
                    break;

                case SortOperation.ModifiedDateAscending:
                    for (int i = 0; i < ZTaskList.Count; i++)
                    {
                        for (int j = i + 1; j < ZTaskList.Count; j++)
                        {
                            if (ZTaskList[i].TaskDetails.ModifiedDate > ZTaskList[j].TaskDetails.ModifiedDate || ZTaskList[i].TaskDetails.ModifiedDate == null)
                            {
                                var tempTask = ZTaskList[i];
                                ZTaskList[i] = ZTaskList[j];
                                ZTaskList[j] = tempTask;
                            }
                        }
                    }
                    break;

                case SortOperation.ModifiedDateDescending:
                    for (int i = 0; i < ZTaskList.Count; i++)
                    {
                        for (int j = i + 1; j < ZTaskList.Count; j++)
                        {
                            if (ZTaskList[i].TaskDetails.ModifiedDate < ZTaskList[j].TaskDetails.ModifiedDate || ZTaskList[i].TaskDetails.ModifiedDate == null)
                            {
                                var tempTask = ZTaskList[i];
                                ZTaskList[i] = ZTaskList[j];
                                ZTaskList[j] = tempTask;
                            }
                        }
                    }
                    break;
                }
            });

            OnOperationCompletion(ZTaskList);
        }