Example #1
0
 /// <summary>
 /// 구글 할일로 변환
 /// </summary>
 /// <returns></returns>
 internal Task ToTask()
 {
     return(new Task()
     {
         Id = Id,
         Title = Title,
         Status = GoogleTaskStatus.GetTaskStatus(IsCompleted)
     });
 }
Example #2
0
        /// <summary>
        /// 해당 할일 데이터 업데이트
        /// </summary>
        /// <param name="taskItem"></param>
        /// <returns></returns>
        public async System.Threading.Tasks.Task UpdateTaskAsync(TaskItem taskItem)
        {
            var service = new GoogleTaskService();
            var newTask = await service.UpdateTaskAsync(taskItem.ToTask(), Id);

            var index = _tasks.FindIndex(t => t.Id == newTask.Id);

            _tasks[index] = new TaskItem(Id, newTask.Id, newTask.Title,
                                         GoogleTaskStatus.CheckIsCompleted(newTask.Status));
        }
Example #3
0
        /// <summary>
        /// 서버에서 할일리스트 로드
        /// </summary>
        /// <returns></returns>
        public async System.Threading.Tasks.Task LoadAsync()
        {
            var service = new GoogleTaskService();
            var tasks   = (await service.GetTasksAsync(Id)).Items;

            if (tasks != null)
            {
                _tasks.AddRange(
                    tasks.Select(task =>
                {
                    return(new TaskItem(Id, task.Id, task.Title,
                                        GoogleTaskStatus.CheckIsCompleted(task.Status)));
                }));
            }
        }