internal static ImportCalendarResults ImportCalendar(Stream inputStream, string charset, InboundConversionOptions options, StoreSession session, StoreObjectId folderId, Deadline deadline) { ImportCalendarResults result; using (CalendarFolder calendarFolder = CalendarFolder.Bind(session, folderId)) { result = ICalSharingHelper.ImportCalendar(inputStream, charset, options, session, calendarFolder, deadline, ExDateTime.MinValue, ExDateTime.MaxValue); } return(result); }
public static ImportCalendarResults ImportCalendar(Stream inputStream, string charset, InboundConversionOptions options, StoreSession session, CalendarFolder folder, Deadline deadline, ExDateTime importWindowStart, ExDateTime importWindowEnd) { ImportCalendarResults results = new ImportCalendarResults(); try { ConvertUtils.CallCts(ExTraceGlobals.ICalTracer, "ICalSharingHelper::ImportCalendar", ServerStrings.ConversionCorruptContent, delegate { new CalendarImporter(inputStream, charset, options, folder, results, deadline, importWindowStart, importWindowEnd).Run(); }); } catch (ConversionFailedException ex) { results.RawErrors.Add(new LocalizedString(ex.ToString())); } catch (ExchangeDataException ex2) { results.RawErrors.Add(new LocalizedString(ex2.ToString())); } return(results); }
public CalendarImporter(Stream inputStream, string charset, InboundConversionOptions options, CalendarFolder folder, ImportCalendarResults results, Deadline deadline, ExDateTime importWindowStart, ExDateTime importWindowEnd) { Util.ThrowOnNullArgument(inputStream, "inputStream"); Util.ThrowOnNullOrEmptyArgument(charset, "charset"); Util.ThrowOnNullArgument(folder, "folder"); Util.ThrowOnNullArgument(results, "results"); Util.ThrowOnNullArgument(deadline, "deadline"); this.inputStream = inputStream; this.charset = charset; this.folder = folder; this.results = results; this.deadline = deadline; this.importWindowStart = importWindowStart; this.importWindowEnd = importWindowEnd; this.session = folder.Session; this.addressCache = new InboundAddressCache(options, new ConversionLimitsTracker(options.Limits), MimeMessageLevel.TopLevelMessage); }