Example #1
0
 private void DoFileDrop(Point pt, string[] files)
 {
     if (files != null && files.Length > 0)
     {
         for (int k = 0; k < files.Length; k++)
         {
             try
             {
                 ImportAppointments(files[k], pt);
             }
             catch (iCalendarInvalidFileFormatException)
             {
                 string message = String.Format(@"The file ""{0}"" is not a valid Internet Calendar file", Path.GetFileName(files[0]));
                 MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             catch (iCalendarEventImportException ex)
             {
                 VEventCollection events = ex.Events;
                 int    count            = events.Count;
                 string message          = String.Empty;
                 for (int i = 0; i < count; i++)
                 {
                     VEvent ev = ex.Events[i];
                     message += String.Format("Unable to import event '{0}' started on {1:D} at {2}\n", ev.Summary.Value, ev.Start.Value.Date, ev.Start.Value.TimeOfDay);
                 }
                 MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             finally
             {
                 AfterImportActions();
             }
         }
     }
 }
Example #2
0
        /// <summary>
        /// The method can be called to clear all current property values in the calendar.  The version is left
        /// unchanged.
        /// </summary>
        /// <remarks>Because time zone information is shared amongst all calendars, the <see cref="TimeZones"/>
        /// collection will not be cleared.  If you want it cleared, you must do it manually.</remarks>
        public override void ClearProperties()
        {
            prodId = null;
            calScale = null;
            method = null;
            geo = null;
            tz = null;
            daylight = null;

            events = null;
            todos = null;
            journals = null;
            freebusy = null;

            customProps = null;
        }