void LeerCalendario(string calendarioname) { //string CalendarName = "\\\\Buzón: Bravo Gabriel (UGAS GROUP)\\Calendario"; //string CalendarName = "\\\\Carpetas personales\\Calendario"; string CalendarName = calendarioname; AppointmentImporter importer = schedulerStorage.CreateOutlookImporter(); ((ISupportCalendarFolders)importer).CalendarFolderName = CalendarName; importer.AppointmentImporting += new AppointmentImportingEventHandler(importer_AppointmentImporting); importer.AppointmentImported += new AppointmentImportedEventHandler(importer_AppointmentImported); Cursor oldCur = Cursor.Current; Cursor.Current = Cursors.WaitCursor; try { importer.Import(System.IO.Stream.Null); } finally { Cursor.Current = oldCur; } }
void importer_OnException(object sender, ExchangeExceptionEventArgs e) { string errText = e.OriginalException.Message; OutlookExchangeExceptionEventArgs args = e as OutlookExchangeExceptionEventArgs; if (args != null) { if (args.OutlookAppointment != null) { errText += String.Format("\r\nEvent '{0}' started on {1:D} at {2}\n", args.OutlookAppointment.Subject, args.OutlookAppointment.Start, args.OutlookAppointment.Start.TimeOfDay); } } AppointmentImporter importer = (AppointmentImporter)sender; importer.Terminate(); e.Handled = true; throw e.OriginalException; }
private IEnumerable<AppointmentDto> MapMeetings(long? id) { var importer = new AppointmentImporter(this.Connection, this.Component); this.Relay(importer); return importer.Import(id); }