Ejemplo n.º 1
0
 protected void CopyFolder(FolderMapping fm)
 {
     base.RefreshRequestIfNeeded();
     base.TimeTracker.CurrentState = RequestState.CopyingMessages;
     base.TestIntegration.Barrier("PostponeWriteMessages", new Action(base.RefreshRequestIfNeeded));
     base.CheckServersHealth();
     ExecutionContext.Create(new DataContext[]
     {
         new FolderRecWrapperDataContext(fm)
     }).Execute(delegate
     {
         if (this.CachedRequestJob.IsPublicFolderMailboxRestore && fm.TargetFolder == null)
         {
             this.Warnings.Add(MrsStrings.FolderIsMissing(HexConverter.ByteArrayToHexString(fm.EntryId)));
             return;
         }
         using (ISourceFolder folder = this.MailboxMerger.SourceMailbox.GetFolder(fm.EntryId))
         {
             if (folder == null)
             {
                 this.Report.Append(MrsStrings.ReportSourceFolderDeleted(fm.FullFolderName, TraceUtils.DumpEntryId(fm.EntryId)));
             }
             else
             {
                 using (IDestinationFolder folder2 = this.MailboxMerger.DestMailbox.GetFolder(fm.TargetFolder.EntryId))
                 {
                     if (folder2 == null)
                     {
                         this.Report.Append(MrsStrings.ReportTargetFolderDeleted(fm.TargetFolder.FullFolderName, TraceUtils.DumpEntryId(fm.TargetFolder.EntryId), fm.FullFolderName));
                     }
                     else
                     {
                         this.Report.Append(MrsStrings.ReportMergingFolder(fm.FullFolderName, fm.TargetFolder.FullFolderName));
                         this.CopyFolderData(fm, folder, folder2);
                         folder2.Flush();
                     }
                 }
             }
         }
     });
     base.SaveState(SaveStateFlags.Lazy, null);
 }