private async Task DeleteEventsAsync(string calendarId, IEnumerable <Event> events)
        {
            var deleteBatch = new UnlimitedBatch(Service);

            foreach (var ev in events)
            {
                deleteBatch.Queue(Service.Events.Delete(calendarId, ev.Id));
            }
            await deleteBatch.ExecuteWithRetryAsync();
        }
Пример #2
0
        public async Task InsertEventsAsync(string calendar, IEnumerable <Event> events)
        {
            var batch = new UnlimitedBatch(Service);

            foreach (var @event in events)
            {
                batch.Queue(Service.Events.Insert(@event, calendar));
            }
            await batch.ExecuteAsync();
        }
Пример #3
0
        public async Task DeleteEventsAsync(string calendar, IEnumerable <string> events)
        {
            var batch = new UnlimitedBatch(Service);

            foreach (var @event in events)
            {
                batch.Queue(Service.Events.Delete(calendar, @event));
            }
            await batch.ExecuteAsync();
        }
        private async Task AddEventsAsync(string calendarId, IEnumerable <Event> events)
        {
            var insertBatch = new UnlimitedBatch(Service);

            foreach (var ev in events)
            {
                var insertRequest = Service.Events.Insert(ev, calendarId);
                insertRequest.Fields = "id";
                insertBatch.Queue(insertRequest);
            }
            await insertBatch.ExecuteWithRetryAsync();
        }
Пример #5
0
        private async Task AddEventsAsync(IEnumerable <Event> events)
        {
            var insertBatch = new UnlimitedBatch(Service);

            foreach (var ev in events)
            {
                ev.ColorId            = eventColor;
                ev.ExtendedProperties = eventProperties;
                var insertRequest = Service.Events.Insert(ev, calendarId);
                insertRequest.Fields = "id";
                insertBatch.Queue(insertRequest);
            }
            await insertBatch.ExecuteWithRetryAsync();
        }