private static bool ExportMessageBatch(ISourceMailbox mailbox, List <MessageRec> messages, Func <IFxProxyPool> getProxyPool, ExportMessagesFlags flags, PropTag[] propsToCopyExplicitly, PropTag[] excludeProps, TestIntegration testIntegration, out Exception failure) { failure = null; try { using (IFxProxyPool fxProxyPool = getProxyPool()) { mailbox.ExportMessages(messages, fxProxyPool, flags, propsToCopyExplicitly, excludeProps); } return(true); } catch (Exception ex) { if (!MapiUtils.IsBadItemIndicator(ex, out failure)) { if (failure != ex) { failure.PreserveExceptionStack(); throw failure; } throw; } } return(false); }
public void MessageExport(ISourceMailbox mailbox, List <MessageRec> messages, ExportMessagesFlags flags, PropTag[] excludeProps) { this.RunExportThread(delegate { using (BufferedTransmitter bufferedTransmitter = new BufferedTransmitter(this, this.service.ExportBufferSizeFromMrsKB, false, this.service.UseBufferring, this.service.UseCompression)) { using (AsynchronousTransmitter asynchronousTransmitter = new AsynchronousTransmitter(bufferedTransmitter, false)) { using (FxProxyPoolTransmitter fxProxyPoolTransmitter = new FxProxyPoolTransmitter(asynchronousTransmitter, false, this.service.ClientVersion)) { mailbox.ExportMessages(messages, fxProxyPoolTransmitter, flags, null, excludeProps); } } } }); }