Exemplo n.º 1
0
        public void WriteEvent(OLCalItem iCalItem)
        {
            iCalFile.WriteLine ("BEGIN:VEVENT");

            // basic VEVENT properties
            iCalFile.WriteLine (text2iCal (iCalItem.SUMMARY));
            iCalFile.WriteLine (iCalItem.DTSTART);
            iCalFile.WriteLine (iCalItem.DTEND);
            iCalFile.WriteLine (iCalItem.DTSTAMP);

            // optional VEVENT properties
            if (iCalItem.LOCATION.Length != 0)
                iCalFile.WriteLine (text2iCal (iCalItem.LOCATION));
            if (iCalItem.DESCRIPTION.Length != 0)
                iCalFile.WriteLine (text2iCal (iCalItem.DESCRIPTION));
            if (iCalItem.TRANSP.Length != 0)
                iCalFile.WriteLine (text2iCal (iCalItem.TRANSP));
            if (iCalItem.CLASS.Length != 0)
                iCalFile.WriteLine (iCalItem.CLASS);
            if (iCalItem.PRIORITY.Length != 0)
                iCalFile.WriteLine (iCalItem.PRIORITY);
            if (iCalItem.CATEGORIES.Length != 0)
                iCalFile.WriteLine (text2iCal (iCalItem.CATEGORIES));

            // write recurrency rule
            if (iCalItem.isRecurrent ())
                WriteRecurrence (iCalItem);

            // write alarm if one exists
            if (iCalItem.hasAlarm ())
                WriteAlarm (iCalItem);

            iCalFile.WriteLine ("END:VEVENT");
        }
Exemplo n.º 2
0
        public void WriteAlarm(OLCalItem iCalItem)
        {
            if (!iCalItem.hasAlarm ())
                return;

            // this writes just the alarm time
            // duration and repeat count are not implemented yet
            iCalFile.WriteLine ("BEGIN:VALARM");
            iCalFile.WriteLine (iCalItem.TRIGGER);
            iCalFile.WriteLine (text2iCal(iCalItem.ALARM_DESCRIPTION));
            iCalFile.WriteLine ("ACTION:DISPLAY");
            iCalFile.WriteLine ("END:VALARM");
        }