Beispiel #1
0
        /// <summary>
        /// Creates the simple event.
        /// </summary>
        /// <param name="titleTxt">Title text.</param>
        /// <param name="fromDate">From date.</param>
        /// <param name="toDate">To date.</param>
        public static void CreateSimpleEvent(string titleTxt, DateTime fromDate, DateTime toDate)
        {
            EKEvent newEvent = EKEvent.Event(eventStore);

            calendar = eventStore.defaultCalendarForNewEvents;
            Debug.Log("in CreateSimpleEvent, output of calendar: " + calendar);
            newEvent.title     = titleTxt;
            newEvent.startDate = fromDate;
            newEvent.endDate   = toDate;
            newEvent.calendar  = calendar;

            eventStore.SaveEvent(newEvent, EKSpan.ThisEvent, null);
            eventStore.SaveCalendar(calendar, true, null);
            eventStore.Commit(null);
        }