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();
        }
        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();
        }
Ejemplo n.º 3
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();
        }