PDA

View Full Version : [.NET] API Google Calendar


Luigi3
03-10-2008, 08:36
Ciao a tutti,

qualcuno di voi ha mai provato ad utilizzare le API per il Calendar di Google? Io sono riuscito e leggere il calendario, ma quando provo a leggere gli eventi non riesco ad ottenere le informazioni aggiuntive tipo StartDate, EndDate e Locations.
Chi mi puo' aiutare?

luigi

Luigi3
08-10-2008, 09:43
Se a qualcuno interessa la risposta è questa:


EventFeed myResultsFeed = myService.Query(myQuery);
foreach (Google.GData.Calendar.EventEntry entry2 in myResultsFeed.Entries)
{
Label1.Text += entry2.Title.Text + "\n";
string strQuando = null;
string strDove = null;

Google.GData.Extensions.WhenCollection eventTime = entry2.Times;
foreach (Google.GData.Extensions.When quando in eventTime)
{
strQuando = quando.StartTime.Day.ToString() + "/" + quando.StartTime.Month.ToString() + "/" + quando.StartTime.Year.ToString();
strQuando += " " + quando.StartTime.TimeOfDay.Hours.ToString() + ":" + quando.StartTime.TimeOfDay.Minutes.ToString();
}

Label1.Text += strQuando;

Google.GData.Extensions.WhereCollection eventLocation = entry2.Locations;
foreach (Google.GData.Extensions.Where dove in eventLocation)
{
strDove = dove.ValueString;
}
Label1.Text += strDove;

}