protected SyncContext EnumerateAndApplyIncrementalChanges()
        {
            SyncContext    syncContext    = base.MailboxMerger.CreateSyncContext();
            MailboxChanges mailboxChanges = new MailboxChanges(base.MailboxMerger.EnumerateHierarchyChanges(syncContext));

            base.Report.Append(MrsStrings.ReportIncrementalSyncHierarchyChanges(base.MailboxMerger.SourceTracingID, mailboxChanges.HierarchyChanges.ChangedFolders.Count, mailboxChanges.HierarchyChanges.DeletedFolders.Count));
            base.EnumerateAndApplyIncrementalChanges(base.MailboxMerger, syncContext, mailboxChanges.HierarchyChanges);
            return(syncContext);
        }
Esempio n. 2
0
 protected override void PerformFolderRecoverySync(MailboxChanges changes, MailboxContentsCrawler crawler)
 {
     foreach (FolderChangesManifest folderChangesManifest in from folderChanges in changes.FolderChanges.Values
              where folderChanges.FolderRecoverySync
              select folderChanges)
     {
         FolderMapping folder = base.MailboxMerger.SourceHierarchy[folderChangesManifest.FolderId] as FolderMapping;
         crawler.ResetFolder(folder);
     }
 }
Esempio n. 3
0
 public override void ApplyContentsChanges(SyncContext ctx, MailboxChanges changes)
 {
     MrsTracer.Service.Function("MailboxMerger.ApplyContentsChanges", new object[0]);
     if (changes.HasFolderRecoverySync)
     {
         return;
     }
     foreach (FolderChangesManifest folderChangesManifest in changes.FolderChanges.Values)
     {
         FolderMapping folderMapping = (FolderMapping)this.SourceHierarchy[folderChangesManifest.FolderId];
         if (folderMapping == null)
         {
             MrsTracer.Service.Warning("Folder {0} is not discovered in source, will not apply changes", new object[]
             {
                 TraceUtils.DumpEntryId(folderChangesManifest.FolderId)
             });
             return;
         }
         using (ISourceFolder folder = base.SourceMailbox.GetFolder(folderMapping.EntryId))
         {
             if (folder == null)
             {
                 MrsTracer.Service.Warning("Folder {0} disappeared from source, will not apply changes", new object[]
                 {
                     TraceUtils.DumpEntryId(folderChangesManifest.FolderId)
                 });
                 return;
             }
             byte[] array = base.FolderIdTranslator.TranslateFolderId(folderChangesManifest.FolderId);
             if (array == null)
             {
                 MrsTracer.Service.Warning("Source folder {0} is not present in target mailbox, will not apply changes", new object[]
                 {
                     TraceUtils.DumpEntryId(folderChangesManifest.FolderId)
                 });
                 return;
             }
             using (IDestinationFolder folder2 = base.DestMailbox.GetFolder(array))
             {
                 if (folder2 == null)
                 {
                     MrsTracer.Service.Warning("Destination folder {0} disappeared, will not apply changes", new object[]
                     {
                         TraceUtils.DumpEntryId(array)
                     });
                     return;
                 }
                 this.ApplyFolderChanges(ctx, folderChangesManifest, folderMapping, folder, folder2);
             }
         }
     }
     base.ReportContentChangesSynced(ctx);
     base.ICSSyncState.ProviderState = base.SourceMailbox.GetMailboxSyncState();
     base.SaveICSSyncState(false);
 }
Esempio n. 4
0
 protected virtual void PerformFolderRecoverySync(MailboxChanges changes, MailboxContentsCrawler crawler)
 {
 }