public void ConvertListData(List <ZTask> ZtaskList) { foreach (ZTask task in ZtaskList) { Ztasks.Add(task); } }
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); } }); }
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); }); }
public void DisplayDelayedTasks() { Ztasks.Clear(); ConvertListData(Delayed); }
public void DisplayUpcomingTasks() { Ztasks.Clear(); ConvertListData(Upcoming); }
public void DisplayTasksAssignedToOthers() { Ztasks.Clear(); ConvertListData(AssignedToOthers); }
public void DisplayTasksForToday() { Ztasks.Clear(); ConvertListData(Today); }
public void DisplayMyTasks() { Ztasks.Clear(); ConvertListData(Home); }
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); }