- 3 minutes to read
This document provides an overview of iCalendar format and its implementation in the XtraScheduler Suite.
The iCalendar format is designed to enable the communication between different scheduling applications over the Internet. The iCalendar RFC 2445 defines the requirements for openly exchanging the scheduling and calendaring information. It is currently the most supported and widely used standard to interoperate between your application and the most popular calendars - Apple iCal, Lotus Notes, Microsoft Outlook, Google Calendar, Novell GroupWise, and Windows Calendar, just to name a few.
The main set of elements included in the iCalendar standard is supported. Tasks and journaling capabilities of RFC 2445, as well as descriptors and extensions specific for a particular calendar application, have been suggested for future versions.
The XtraScheduler Suite provides two classes designed for export and import operations with data in iCalendar format - the iCalendarExporter and iCalendarImporter. Their constructors take a SchedulerDataStorage instance as a parameter specifying the appointment’s location. When the iCalendarExporter is created, it provides information on the number of objects intended for export via the AppointmentExchanger.SourceObjectCount property. It can be used to adjust the progress indicator.
You can decide for each calendar item how they should be handled. Two pairs of events are designed for this purpose. The AppointmentExporter.AppointmentExporting and AppointmentImporter.AppointmentImporting events are raised before an item is processed. The Cancel event argument enables you to exclude the item from the resulting data. The AppointmentExporter.AppointmentExported and AppointmentImporter.AppointmentImported events occur when the process is complete.
You can also take advantage of the CalendarStructureCreated event. It enables you to get access to data arranged as determined by iCalendar format.
Use the static iCalendarHelper.ExtractRecurrenceRule method to obtain the recurrence rule as a string defined in RFC 2445 (RRULE in iCalendar format). To apply a rule to the existing RecurrenceInfo object use the iCalendarHelper.ApplyRecurrenceRule method.
The iCalendarStructureCreatedEventArgs.Calendars property exposes a collection of iCalendar components. Each iCalendarComponent represents an iCalendar object as defined in RFC 2445.
The Events property provides access to a collection of VEvent objects, representing individual calendar components. A diagram for the VEvent class is shown below:
For iCalendarComponent and VEvent classes the property names correspond to properties defined in RFC 2445. For more information, refer to Internet Calendaring and Scheduling Core Object Specification.
Custom properties (non-standard properties, not defined explicitly in iCalendar standard) are named using prefix text of “X-“ followed by a short string containing a vendor identifier. You can set this identifier via the iCalendarExporter.CustomPropertyIdentifier and iCalendarImporter.CustomPropertyIdentifier properties. Note that Appointment Labels are non-standard for iCalendar, and have to be encoded using the technique described.
Every iCalendar object should also have an identifier specifying the application that created it. You can set it via the iCalendarExporter.ProductIdentifier property.