简体   繁体   English

Google Calendar API V3-Event.Recurrence始终为null

[英]Google Calendar API V3 - Event.Recurrence always null

I try to create a Calendar Synchronisation between my Application and the Google Calendar. 我尝试在我的应用程序和Google日历之间创建日历同步。

But now I have a Problem I just can't solve.. 但是现在我有一个我无法解决的问题。

I'm getting all Events from the Calendar like this: 我从日历中获取所有事件,如下所示:

EventsResource.ListRequest request = service.Events.List("primary");
request.TimeMin = new DateTime(1990,1,1);
request.ShowDeleted = false;
request.SingleEvents = true;
request.MaxResults = 1000;
request.OrderBy = EventsResource.ListRequest.OrderByEnum.StartTime;

Events events = request.Execute();
foreach(Event ev in events.Items)
{
    String s = ev.Recurrence;//Recurrence is always null
}

But ev.Recurrence is never filled, also when ev.RecurringEventId is filled. 但是, ev.Recurrence填充了ev.Recurrence ,也不会填充ev.RecurringEventId

Recurrence property of the Event object is not populated for single events or instances of the recurring event. 对于单个事件或重复事件的实例,不会填充Event对象的Recurrence属性。 This is what google is saying about that field: 这就是谷歌在该领域所说的话:

This field contains list of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event, as specified in RFC5545. 此字段包含重复事件的RRULE,EXRULE,RDATE和EXDATE行的列表,如RFC5545中所指定。 Note that DTSTART and DTEND lines are not allowed in this field; 请注意,此字段中不允许使用DTSTART和DTEND行。 event start and end times are specified in the start and end fields. 事件的开始和结束时间在开始和结束字段中指定。 This field is omitted for single events or instances of recurring events. 对于单个事件或重复发生的事件,将省略此字段。

RecurringEventId property of the Event object is provided, well, for instances of the recurring event. 同样,为重复事件的实例提供了Event对象的RecurringEventId属性。 It's not gonna be populated for the non-recurring events. 不会为非经常性事件填充它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM