代码之家  ›  专栏  ›  技术社区  ›  petko_stankoski

何时单个iCalendar事件会有多个重复规则?

  •  2
  • petko_stankoski  · 技术社区  · 7 年前

    我使用ical。NET库,用于在C#中处理iCalendar事件。

    我注意到一个日历事件可以有多个重复规则。这是什么时候的情况?

    CalendarEvent类扩展了RecurringComponent类,该类具有以下属性:

    public virtual IList<RecurrencePattern> RecurrenceRules { get; set; }
    

    为什么这是一个列表?我认为它应该是一个RecurrencePattern元素,而不是一个列表。

    1 回复  |  直到 7 年前
        1
  •  3
  •   Community CDub    3 年前

    很可能是由于向后兼容性原因:

    RFC2445支持多个RRULE和EXRULE: https://www.rfc-editor.org/rfc/rfc2445#section-4.6.1

    ; 以下是可选的, ; 并且可能发生多次

                attach / attendee / categories / comment /
                contact / exdate / exrule / rstatus / related /
                resources / rdate / rrule / x-prop
    

    淘汰RFC2445的RFC5545删除了该功能,因为大多数客户机要么没有实现,要么实现得很差。 https://www.rfc-editor.org/rfc/rfc5545#section-3.6.1

    ; 但不应发生多次。 ; rrule公司/

    请注意,当RFC5545删除EXRULE时,RFC2445如何也有EXRULE的概念。更改的完整列表 https://www.rfc-editor.org/rfc/rfc5545#appendix-A