void ISourceFolder.CopyTo(IFxProxy destFolderProxy, CopyPropertiesFlags flags, PropTag[] excludeTags)
        {
            MrsTracer.Provider.Function("StorageSourceFolder.CopyTo({0})", new object[]
            {
                base.DisplayNameForTracing
            });
            if ((base.Mailbox.Flags & LocalMailboxFlags.StripLargeRulesForDownlevelTargets) != LocalMailboxFlags.None)
            {
                flags |= CopyPropertiesFlags.StripLargeRulesForDownlevelTargets;
            }
            bool exportCompleted = false;

            CommonUtils.ProcessKnownExceptions(delegate
            {
                using (this.Mailbox.RHTracker.Start())
                {
                    using (FxProxyBudgetWrapper fxProxyBudgetWrapper = new FxProxyBudgetWrapper(destFolderProxy, false, new Func <IDisposable>(this.Mailbox.RHTracker.StartExclusive), new Action <uint>(this.Mailbox.RHTracker.Charge)))
                    {
                        this.MapiFolder.ExportObject(fxProxyBudgetWrapper, flags, excludeTags);
                    }
                }
                exportCompleted = true;
                destFolderProxy.Flush();
            }, delegate(Exception ex)
            {
                if (!exportCompleted)
                {
                    MrsTracer.Provider.Debug("Flushing target proxy after receiving an exception.", new object[0]);
                    CommonUtils.CatchKnownExceptions(new Action(destFolderProxy.Flush), null);
                }
                return(false);
            });
        }
        void ISourceFolder.ExportMessages(IFxProxy destFolderProxy, CopyMessagesFlags flags, byte[][] entryIds)
        {
            MrsTracer.Provider.Function("StorageSourceFolder.ExportMessages({0})", new object[]
            {
                base.DisplayNameForTracing
            });
            bool exportCompleted = false;

            CommonUtils.ProcessKnownExceptions(delegate
            {
                using (this.Mailbox.RHTracker.Start())
                {
                    using (FxProxyBudgetWrapper fxProxyBudgetWrapper = new FxProxyBudgetWrapper(destFolderProxy, false, new Func <IDisposable>(this.Mailbox.RHTracker.StartExclusive), new Action <uint>(this.Mailbox.RHTracker.Charge)))
                    {
                        this.MapiFolder.ExportMessages(fxProxyBudgetWrapper, flags, entryIds);
                    }
                }
                exportCompleted = true;
                destFolderProxy.Flush();
            }, delegate(Exception ex)
            {
                if (!exportCompleted)
                {
                    MrsTracer.Provider.Debug("Flushing target proxy after receiving an exception.", new object[0]);
                    CommonUtils.CatchKnownExceptions(new Action(destFolderProxy.Flush), null);
                }
                return(false);
            });
        }
示例#3
0
        void ISourceMailbox.CopyTo(IFxProxy fxProxy, PropTag[] excludeTags)
        {
            MrsTracer.Provider.Function("MapiSourceMailbox.CopyTo", new object[0]);
            base.VerifyMailboxConnection(VerifyMailboxConnectionFlags.None);
            bool flag = false;

            try
            {
                CopyPropertiesFlags copyPropertiesFlags = CopyPropertiesFlags.None;
                if ((base.Flags & LocalMailboxFlags.StripLargeRulesForDownlevelTargets) != LocalMailboxFlags.None)
                {
                    copyPropertiesFlags |= CopyPropertiesFlags.StripLargeRulesForDownlevelTargets;
                }
                using (base.RHTracker.Start())
                {
                    using (FxProxyBudgetWrapper fxProxyBudgetWrapper = new FxProxyBudgetWrapper(fxProxy, false, new Func <IDisposable>(base.RHTracker.StartExclusive), new Action <uint>(base.RHTracker.Charge)))
                    {
                        base.MapiStore.ExportObject(fxProxyBudgetWrapper, copyPropertiesFlags, excludeTags);
                    }
                }
                flag = true;
                fxProxy.Flush();
            }
            finally
            {
                if (!flag)
                {
                    MrsTracer.Provider.Debug("Flushing target proxy after receiving an exception.", new object[0]);
                    CommonUtils.CatchKnownExceptions(new Action(fxProxy.Flush), null);
                }
            }
        }
示例#4
0
        void ISourceFolder.ExportMessages(IFxProxy destFolderProxy, CopyMessagesFlags flags, byte[][] entryIds)
        {
            MrsTracer.Provider.Function("MapiSourceFolder.CopyTo", new object[0]);
            bool flag = false;

            try
            {
                using (base.Mailbox.RHTracker.Start())
                {
                    using (FxProxyBudgetWrapper fxProxyBudgetWrapper = new FxProxyBudgetWrapper(destFolderProxy, false, new Func <IDisposable>(base.Mailbox.RHTracker.StartExclusive), new Action <uint>(base.Mailbox.RHTracker.Charge)))
                    {
                        base.Folder.ExportMessages(fxProxyBudgetWrapper, flags, entryIds);
                    }
                }
                flag = true;
                destFolderProxy.Flush();
            }
            catch (LocalizedException)
            {
                if (!flag)
                {
                    MrsTracer.Provider.Debug("Flushing target proxy after receiving an exception.", new object[0]);
                    CommonUtils.CatchKnownExceptions(new Action(destFolderProxy.Flush), null);
                }
                throw;
            }
        }
示例#5
0
        void ISourceFolder.CopyTo(IFxProxy destFolderProxy, CopyPropertiesFlags flags, PropTag[] excludeTags)
        {
            MrsTracer.Provider.Function("MapiSourceFolder.CopyTo", new object[0]);
            if ((base.Mailbox.Flags & LocalMailboxFlags.StripLargeRulesForDownlevelTargets) != LocalMailboxFlags.None)
            {
                flags |= CopyPropertiesFlags.StripLargeRulesForDownlevelTargets;
            }
            bool flag = false;

            try
            {
                using (base.Mailbox.RHTracker.Start())
                {
                    using (FxProxyBudgetWrapper fxProxyBudgetWrapper = new FxProxyBudgetWrapper(destFolderProxy, false, new Func <IDisposable>(base.Mailbox.RHTracker.StartExclusive), new Action <uint>(base.Mailbox.RHTracker.Charge)))
                    {
                        base.Folder.ExportObject(fxProxyBudgetWrapper, flags, excludeTags);
                    }
                }
                flag = true;
                destFolderProxy.Flush();
            }
            catch (LocalizedException)
            {
                if (!flag)
                {
                    MrsTracer.Provider.Debug("Flushing target proxy after receiving an exception.", new object[0]);
                    CommonUtils.CatchKnownExceptions(new Action(destFolderProxy.Flush), null);
                }
                throw;
            }
        }
示例#6
0
        void ISourceFolder.CopyTo(IFxProxy fxFolderProxy, CopyPropertiesFlags flags, PropTag[] propTagsToExclude)
        {
            MrsTracer.Provider.Function("PstSourceFolder.ISourceFolder.CopyTo", new object[0]);
            bool exportCompleted = false;

            CommonUtils.ProcessKnownExceptions(delegate
            {
                FxCollectorSerializer fxCollectorSerializer = new FxCollectorSerializer(fxFolderProxy);
                fxCollectorSerializer.Config(0, 1);
                using (FastTransferDownloadContext fastTransferDownloadContext = FastTransferDownloadContext.CreateForDownload(FastTransferSendOption.Unicode | FastTransferSendOption.UseCpId | FastTransferSendOption.ForceUnicode, 1U, Encoding.ASCII, NullResourceTracker.Instance, this.GetPropertyFilterFactory(PstMailbox.MoMTPtaFromPta(propTagsToExclude)), false))
                {
                    IFastTransferProcessor <FastTransferDownloadContext> fastTransferObject = FastTransferFolderCopyTo.CreateDownloadStateMachine(this.Folder, FastTransferFolderContentBase.IncludeSubObject.None);
                    fastTransferDownloadContext.PushInitial(fastTransferObject);
                    FxUtils.TransferFxBuffers(fastTransferDownloadContext, fxCollectorSerializer);
                }
                exportCompleted = true;
                fxFolderProxy.Flush();
            }, delegate(Exception ex)
            {
                if (!exportCompleted)
                {
                    MrsTracer.Provider.Debug("Flushing target proxy after receiving an exception.", new object[0]);
                    CommonUtils.CatchKnownExceptions(new Action(fxFolderProxy.Flush), null);
                }
                return(false);
            });
        }
示例#7
0
 void IFxProxy.Flush()
 {
     base.CreateContext("IFxProxy.Flush", new DataContext[0]).Execute(delegate
     {
         IFxProxy fxProxy = base.WrappedObject as IFxProxy;
         if (fxProxy != null)
         {
             fxProxy.Flush();
         }
     }, true);
 }
        void IFxProxy.Flush()
        {
            IFxProxy fxProxy = base.WrappedObject as IFxProxy;

            if (fxProxy != null)
            {
                using (base.CreateCostHandle())
                {
                    fxProxy.Flush();
                }
            }
        }