Pergunta

Im wondering what to add to my project (import? reference?) to be able to use Where()- and When()-methods for the Google calendar.

Code:

Where eventLocation = new Where();
eventLocation.ValueString = "South Tennis Courts";
entry.Locations.Add(eventLocation);

When eventTime = new When(DateTime.Now, DateTime.Now.AddHours(2));
entry.Times.Add(eventTime);

Errors:

Error 1 The type or namespace name 'Where' could not be found (are you missing a using directive or an assembly reference?)

Error 3 The type or namespace name 'When' could not be found (are you missing a using directive or an assembly reference?)  

UPDATE: Current imports:

using Google.GData.Client;
using Google.GData.Calendar;
using Google.GData.Extensions;
using Google.GData.AccessControl;
Foi útil?

Solução

The Google API doc page for the Where class lists the DLL that you need to add as a reference, and the namespace within that assembly:

Namespace: Google.GData.Extensions

Assembly: Google.GData.Extensions (in Google.GData.Extensions.dll)

This works correctly for me in VS2012, using the latest API download (2.2.0) from this page, dated June 2013. MSI hardlink here.

It's not an obvious location if you look at the list of DLLs installed as part of the API setup (the obvious guess would have been Google.GData.Calendar.dll).

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top