|
Re: Efficiently Deleteng All Events in a Calendar: msg#00280org.google.api.calendar
Jenyphur wrote: > > Can you post your code so I can see if we are doing things the same > way? Thanks. > My code is very standard and as follows. One important point is that I found it possible to make use of the ".NextChunk()" method; doing so always returned a result that was incompatible with the query.Uri property, so resulting in a run-time abort. In the end I just read all the events in one go. John Precis of code: string calendarURI = "myUrl"; string userName = "xxxxx@xxxxxxxxxxxxxx"; string passWord = "mypassword"; EventQuery query = new EventQuery(); CalendarService service = new CalendarService(ApplicationName); if (userName != null) { service.setUserCredentials(userName, passWord); } query.Uri = new Uri(calendarURI); query.NumberToRetrieve=999; EventFeed calFeed = service.Query(query); DeleteEvents (calFeed, query, service); private void DeleteEvents (EventFeed calFeed, EventQuery query, CalendarService service){ int i=0; while (calFeed != null && calFeed.Entries.Count > 0) { foreach (EventEntry entry in calFeed.Entries){ i++; Response.Write (i.ToString() + " Deleting: " + entry.Title.Text + "<br />"); entry.Delete(); } calFeed = null; } } |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Custom Fields: 00280, Charlie Wood |
|---|---|
| Next by Date: | Re: Efficiently Deleteng All Events in a Calendar: 00280, jwalton@xxxxxxxxx |
| Previous by Thread: | Re: Efficiently Deleteng All Events in a Calendari: 00280, Jenyphur |
| Next by Thread: | Re: Efficiently Deleteng All Events in a Calendar: 00280, Frank Mantek |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |