martedì 30 ottobre 2012

C# Google API - Create a Calendar

Sometimes, could be useful have differents calendar, for example one for work and one for privacy, the following code shows how to create a calendar.
The example shows how specify title, summary, and color of the calendar.

private void CreateCalendar()
            CalendarService service = new CalendarService("appName");
            service.setUserCredentials("", "yourPassword");

            CalendarEntry calendar = new CalendarEntry();
            calendar.Title.Text = "Calendar Title";
            calendar.Summary.Text = "Calendar Description";
            calendar.Hidden = false;
            calendar.Color = "#2952A3";

            Uri postUri = new Uri("");
            CalendarEntry createdCalendar = (CalendarEntry)service.Insert(postUri, calendar);

** I want to remeber to go here to get  Application-specific password

My Two Cents...

Nessun commento:

Posta un commento