private void
InsertCalendarFeed()
{
CalendarService
service = new CalendarService("cl");
service.setUserCredentials("yourMail@gmail.com", "yourPassword");
service.QueryClientLoginToken();
EventEntry
entry = new EventEntry();
entry.Title.Text = txt_titolo.Text;
entry.Content.Content = "the content of the feed";
When w = new
When();
DateTime
start = Convert.ToDateTime("start date--> dd/mm/yyyy hh:mm:ss");
DateTime
end = Convert.ToDateTime("end date--> dd/mm/yyyy hh:mm:ss");
w.StartTime = start;
w.EndTime = end;
entry.Times.Add(w);
//select the calendar where the feed will be inserted
//"cmb_calendars"
is a ComboBox on the form containing the calendar.
Uri
postUri = new Uri("http://www.google.com/calendar/feeds/"
+ ((ComboboxItem)cmb_calendars.SelectedItem).Value.ToString()
+ "/private/full");
AtomEntry
insertedEntry = service.Insert(postUri, entry);
// insert ok
}
Nessun commento:
Posta un commento