Back to Devexpress

iCalendarExporter.CalendarStructureCreated Event

corelibraries-devexpress-dot-xtrascheduler-dot-icalendar-dot-icalendarexporter-463e33f6.md

latest3.9 KB
Original Source

iCalendarExporter.CalendarStructureCreated Event

Fires when the calendar object conforming to the iCalendar specification is created.

Namespace : DevExpress.XtraScheduler.iCalendar

Assembly : DevExpress.XtraScheduler.v25.2.Core.Desktop.dll

NuGet Package : DevExpress.Scheduler.CoreDesktop

Declaration

csharp
public event iCalendarStructureCreatedEventHandler CalendarStructureCreated
vb
Public Event CalendarStructureCreated As iCalendarStructureCreatedEventHandler

Event Data

The CalendarStructureCreated event's data class is iCalendarStructureCreatedEventArgs. The following properties provide information specific to this event:

PropertyDescription
CalendarsProvides access to the calendar structures conforming to the iCalendar specification.

Remarks

Handle the CalendarStructureCreated event to get access to information on the iCalendar object, using its properties and attributes, before it is exported.

The following example illustrates how you can change the default METHOD value (currently set to PUBLISH) of the VCalendar component, located in iCalendar file, as shown below:

BEGIN:VCALENDAR

PRODID:-//ACME/DesktopCalendar//EN

METHOD:PUBLISH

The RFC 2446 specifies different methods that are defined for the “VEVENT” calendar component (e.g. REQUEST that makes a request for an event, CANCEL that cancels one or more instances of an existing event and others).

To modify the method’s value, use the calendar structure constructed by the iCalendarExporter and available via handling the iCalendarImporter.CalendarStructureCreated event.

csharp
using DevExpress.XtraScheduler.iCalendar;
using DevExpress.XtraScheduler.iCalendar.Components;
// ...
    iCalendarExporter exporter = new iCalendarExporter(schedulerStorage1, aptCollection);
    exporter.CalendarStructureCreated += 
        new iCalendarStructureCreatedEventHandler(exporter_CalendarStructureCreated);
void exporter_CalendarStructureCreated(object sender, iCalendarStructureCreatedEventArgs e)
        {
            iCalendarComponent cal = e.Calendars[0];
            ((StringPropertyBase)(cal.Method)).Value = "REQUEST";
        }
vb
Imports DevExpress.XtraScheduler.iCalendar
Imports DevExpress.XtraScheduler.iCalendar.Components
' ...
    Private exporter As iCalendarExporter = New iCalendarExporter(schedulerStorage1, aptCollection)
    AddHandler exporter.CalendarStructureCreated, AddressOf exporter_CalendarStructureCreated

Private Sub exporter_CalendarStructureCreated(ByVal sender As Object, _
        ByVal e As iCalendarStructureCreatedEventArgs)
            Dim cal As iCalendarComponent = e.Calendars(0)
            CType(cal.Method, StringPropertyBase).Value = "REQUEST"
End Sub

See Also

CalendarStructureCreated

iCalendarExporter Class

iCalendarExporter Members

DevExpress.XtraScheduler.iCalendar Namespace