コード例 #1
0
        public static async Task <IList <(Task task, global::Google.Apis.Tasks.v1.Data.Task cloudTask)> > CreateExistingObjects(
            this XafApplication application, string title, TaskStatus taskStatus = TaskStatus.InProgress, int count = 1)
        {
            var credential = await application.AuthorizeTestGoogle();

            var tasksService = credential.NewService <global::Google.Apis.Tasks.v1.TasksService>();
            var folder       = await tasksService.GetTaskList(TasksFolderName, true);

            await tasksService.DeleteAllTasks(folder.Id);

            return(await Observable.Range(0, count).SelectMany(i => tasksService.NewTaskListTasks(1, folder.Id, title)
                                                               .Select((cloudTask, i1) => (application.NewTask(taskStatus, i1), cloudTask))).Buffer(count));
        }
コード例 #2
0
        public static async Task <IList <(Event local, global::Google.Apis.Calendar.v3.Data.Event cloudEvent)> > CreateExistingObjects(
            this XafApplication application, string title, int count = 1)
        {
            var credential = await application.AuthorizeTestGoogle();

            var calendarService = credential.NewService <global::Google.Apis.Calendar.v3.CalendarService>();
            var calendar        = await calendarService.GetCalendar(CalendarName, true);

            await calendarService.DeleteAllEvents(calendar.Id);

            return(await Observable.Range(0, count)
                   .SelectMany(_ => calendarService.NewCalendarEvents(1, calendar.Id, title)
                               .SelectMany(lst => lst).Select(outlookTask1 => (application.NewEvent(), outlookTask1)))
                   .Buffer(count));
        }