private static IFolderProxy GetFolderProxyForExportFolder(IFxProxyPool proxyPool, IFolder sourceFolder, ExportFoldersDataToCopyFlags exportFoldersDataToCopyFlags, GetFolderRecFlags folderRecFlags, PropTag[] additionalFolderRecProps) { IFolderProxy result; if ((exportFoldersDataToCopyFlags & ExportFoldersDataToCopyFlags.OutputCreateMessages) == ExportFoldersDataToCopyFlags.OutputCreateMessages) { FolderRec folderRec = sourceFolder.GetFolderRec(additionalFolderRecProps, folderRecFlags); result = proxyPool.CreateFolder(folderRec); } else { result = proxyPool.GetFolderProxy(sourceFolder.GetFolderId()); } return(result); }
internal void CopyBatch(IFxProxyPool proxyPool, List <MessageRec> batch) { StorageSourceFolder.< > c__DisplayClass9 CS$ < > 8__locals1 = new StorageSourceFolder.< > c__DisplayClass9(); CS$ < > 8__locals1.< > 4__this = this; if (batch.Count == 0) { return; } byte[][] array = new byte[batch.Count][]; for (int i = 0; i < batch.Count; i++) { array[i] = batch[i].EntryId; } CS$ < > 8__locals1.flags = CopyMessagesFlags.SendEntryId; using (IMapiFxProxy destFolderProxy = proxyPool.GetFolderProxy(base.FolderId)) { if (destFolderProxy == null) { MrsTracer.Provider.Warning("Destination folder {0} does not exist.", new object[] { TraceUtils.DumpEntryId(base.FolderId) }); } else { MapiUtils.ProcessMapiCallInBatches <byte[]>(array, delegate(byte[][] smallBatch) { using (CS$ < > 8__locals1.< > 4__this.Mailbox.RHTracker.Start()) { using (FxProxyBudgetWrapper fxProxyBudgetWrapper = new FxProxyBudgetWrapper(destFolderProxy, false, new Func <IDisposable>(CS$ < > 8__locals1.< > 4__this.Mailbox.RHTracker.StartExclusive), new Action <uint>(CS$ < > 8__locals1.< > 4__this.Mailbox.RHTracker.Charge))) { CS$ < > 8__locals1.< > 4__this.MapiFolder.ExportMessages(fxProxyBudgetWrapper, CS$ < > 8__locals1.flags, smallBatch); } } }); } } }