Example #1
0
 async public Task <TaskDao> GetTaskDao()
 {
     if (taskDao == null)
     {
         taskDao = await TaskDao.GetObject();
     }
     return(taskDao);
 }
Example #2
0
        public static async Task <TaskDao> GetObject()
        {
            TaskDao       taskDao       = new TaskDao();
            Authenticator authenticator = new Authenticator();

            taskDao.accessToken = await authenticator.GetValidAccessToken();

            taskDao.authenticator = authenticator;
            return(taskDao);
        }
Example #3
0
        /* 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();
        }