protected override void InternalDispose(bool disposing) { if (disposing && this.Proxy != null) { this.Proxy.Dispose(); this.Proxy = null; } base.InternalDispose(disposing); }
IFxProxy IDestinationFolder.GetFxProxy(FastTransferFlags flags) { MrsTracer.Provider.Function("MapiDestinationFolder.GetFxProxy", new object[0]); IFxProxy result; using (base.Mailbox.RHTracker.Start()) { IMapiFxProxy fxProxyCollector = base.Folder.GetFxProxyCollector(); IFxProxy proxy = new FxProxyBudgetWrapper(fxProxyCollector, true, new Func <IDisposable>(base.Mailbox.RHTracker.Start), new Action <uint>(base.Mailbox.RHTracker.Charge)); IFxProxy fxProxy = new FxProxyWrapper(proxy, null); result = fxProxy; } return(result); }
IFxProxy IDestinationFolder.GetFxProxy(FastTransferFlags flags) { MrsTracer.Provider.Function("StorageDestinationFolder.GetFxProxy: {0}", new object[] { base.DisplayNameForTracing }); IFxProxy result; using (base.Mailbox.RHTracker.Start()) { IMapiFxProxy destProxy = flags.HasFlag(FastTransferFlags.PassThrough) ? base.CoreFolder.GetFxProxyCollector() : new StorageFolderProxy(this, base.Mailbox.Flags.HasFlag(LocalMailboxFlags.Move)); IFxProxy proxy = new FxProxyBudgetWrapper(destProxy, true, new Func <IDisposable>(base.Mailbox.RHTracker.Start), new Action <uint>(base.Mailbox.RHTracker.Charge)); IFxProxy fxProxy = new FxProxyWrapper(proxy, null); result = fxProxy; } 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); } } }); } } }