【发布时间】:2011-06-29 19:01:29
【问题描述】:
我正在尝试在使用此代码将事件添加到 Google 日历时设置作者:
CalendarService service = new CalendarService("TestApp");
service.setUserCredentials("example@gmail.com", "1234");
EventEntry entry = new EventEntry();
// Set the title and content of the entry.
entry.Title.Text = "Test";
entry.Content.Content = "Test";
// Not working
AtomPerson author = new AtomPerson(AtomPersonType.Author);
author.Name = "John Doe";
author.Email = "john@example.com";
entry.Authors.Add(author);
When eventTime = new When(activity.Start, activity.End, activity.Start == activity.End ? true : false);
entry.Times.Add(eventTime);
Uri postUri = new Uri("https://www.google.com/calendar/feeds/default/private/full");
// Send the request and receive the response:
AtomEntry insertedEntry = service.Insert(postUri, entry);
添加了除作者之外的所有正确属性的事件。作者仍然是日历的所有者。有什么想法吗?
【问题讨论】:
标签: c# .net google-api google-calendar-api