public PstWriter(PstTarget target, IProgressController progressController) { this.progressController = progressController; this.target = target; this.timer = new Stopwatch(); this.targetFolderProvider = new PstTargetFolderProvider(); this.pstMBFileCount = 1; this.unsearchableMBTotalSize = 0L; this.searchableMBTotalSize = 0L; this.pstPFFileCount = 1; this.unsearchablePFTotalSize = 0L; this.searchablePFTotalSize = 0L; }
internal static IExportHandler CreateExportHandler(IExportContext exportContext, ITracer tracer, IServiceClientFactory serviceClientFactory) { if (exportContext == null) { throw new ArgumentNullException("exportContext"); } if (exportContext.Sources == null || exportContext.Sources.Count == 0) { throw new ArgumentNullException("exportContext.Sources"); } for (int i = 0; i < exportContext.Sources.Count; i++) { ISource source = exportContext.Sources[i]; if (source == null) { throw new ArgumentNullException(string.Format(CultureInfo.CurrentCulture, "exportContext.Source[{0}]", new object[] { i })); } if (string.IsNullOrEmpty(source.Name)) { throw new ArgumentNullException(string.Format(CultureInfo.CurrentCulture, "exportContext.Source[{0}].Name", new object[] { i })); } if (string.IsNullOrEmpty(source.Id)) { throw new ArgumentNullException(string.Format(CultureInfo.CurrentCulture, "exportContext.Source[{0}].Id", new object[] { i })); } if (string.IsNullOrEmpty(source.SourceFilter)) { throw new ArgumentNullException(string.Format(CultureInfo.CurrentCulture, "exportContext.Source[{0}].SourceFilter", new object[] { i })); } } if (exportContext.ExportMetadata == null) { throw new ArgumentNullException("exportContext.ExportMetadata"); } if (string.IsNullOrEmpty(exportContext.ExportMetadata.ExportName)) { throw new ArgumentNullException("exportContext.ExportMetadata.ExportName"); } if (exportContext.ExportMetadata.ExportStartTime == default(DateTime)) { throw new ArgumentNullException("exportContext.ExportMetadata.ExportStartTime"); } if (exportContext.TargetLocation == null) { throw new ArgumentNullException("exportContext.TargetLocation"); } PstTarget pstTarget = new PstTarget(exportContext); pstTarget.CheckLocation(); return(ExportHandlerFactory.CreateExportHandler(tracer, pstTarget, serviceClientFactory)); }