public PushNotificationHelper(TaskList list) { List = list; EnableNotifications(); }
public void LoadListsFromResponse(Response response) { TaskListCollection temp = new TaskListCollection(this); if (response.Lists != null) { using (new UnsyncedScope(temp)) { foreach (var list in response.Lists) { if (list.Archived == 0 && list.Deleted == 0) { TaskList newList = new TaskList(list); temp.Add(newList); } } temp.Sort(); } } System.Threading.Interlocked.Exchange(ref mTaskLists, temp); }
private void LoadDataInBackground() { SmartDispatcher.BeginInvoke(() => { //GlobalLoading.Instance.IsLoadingText(Strings.SyncingTasks); if (App.RtmClient.TaskLists != null) { var tempAllTasks = new SortableObservableCollection<Task>(); var tempTaskLists = new SortableObservableCollection<TaskList>(); var tempTaskTags = new SortableObservableCollection<TaskTag>(); foreach (TaskList l in App.RtmClient.TaskLists) { if (l.Tasks != null && l.IsNormal == true) { foreach (Task t in l.Tasks) { if (t.IsCompleted == true || t.IsDeleted == true) continue; if (t.DueDateTime.HasValue && t.DueDateTime.Value.Date <= DateTime.Now.AddDays(1).Date) { tempAllTasks.Add(t); } } } if (l.Name.ToLower() == "all tasks") tempTaskLists.Insert(0, l); else tempTaskLists.Add(l); } //tempAllTasks.Sort(Task.CompareByDate); // insert the nearby list placeholder TaskList nearby = new TaskList("Nearby"); tempTaskLists.Insert(1, nearby); foreach (var tag in App.RtmClient.GetTasksByTag().OrderBy(z => z.Key)) { TaskTag data = new TaskTag(); data.Name = tag.Key; data.Count = tag.Value.Count; tempTaskTags.Add(data); } AllTasks = tempAllTasks; TaskLists = tempTaskLists; TaskTags = tempTaskTags; ToggleLoadingText(); ToggleEmptyText(); //GlobalLoading.Instance.IsLoading = false; ShowLastUpdatedStatus(); } }); }