async public Task <TaskDao> GetTaskDao() { if (taskDao == null) { taskDao = await TaskDao.GetObject(); } return(taskDao); }
public static async Task <TaskDao> GetObject() { TaskDao taskDao = new TaskDao(); Authenticator authenticator = new Authenticator(); taskDao.accessToken = await authenticator.GetValidAccessToken(); taskDao.authenticator = authenticator; return(taskDao); }
/* Gets taskLists from XML file or web */ async public Task GetTaskListsAsync(bool force) { StorageFolder folder = ApplicationData.Current.LocalFolder; if (!force && await FileExists(folder, FileName)) { Stream reader = await folder.OpenStreamForReadAsync(FileName); this.TaskLists = (ObservableCollection <Kompitu.Data.Model.TaskList>)serializer.Deserialize(reader); } else { TaskDao taskDao = await GetTaskDao(); this.TaskLists = await taskDao.GetTaskLists(); } RefreshLists(); }