private void ApplyFolderChanges(SyncContext ctx, FolderChangesManifest folderChanges, FolderMapping fm, ISourceFolder srcFolder, IDestinationFolder destFolder) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; FolderContentsMapper folderContentsMapper = FolderContentsMapper.Create(fm, srcFolder, this.SourceHierarchy, destFolder, this.DestHierarchy, base.MRSJob.CachedRequestJob.ConflictResolutionOption ?? ConflictResolutionOption.KeepSourceItem, base.MRSJob.CachedRequestJob.AssociatedMessagesCopyOption ?? FAICopyOption.DoNotCopy, (base.MRSJob.CachedRequestJob.SyncProtocol == SyncProtocol.Imap) ? FolderContentsMapperFlags.ImapSync : FolderContentsMapperFlags.None); List <MessageRec> list; byte[][] array; byte[][] array2; byte[][] array3; int skipped; folderContentsMapper.ComputeIncrementalMapping(folderChanges, (base.SyncState == null) ? null : base.SyncState.BadItems, out list, out array, out array2, out array3, out skipped); this.CopyMessageBatch(folderContentsMapper, list, fm); destFolder.DeleteMessages(array); destFolder.SetReadFlagsOnMessages(SetReadFlags.None, array2); destFolder.SetReadFlagsOnMessages(SetReadFlags.ClearRead, array3); if (list != null) { foreach (MessageRec messageRec in list) { if (messageRec.IsNew) { num++; } else { num2++; } } } if (array != null) { num3 += array.Length; } if (array2 != null) { num4 += array2.Length; } if (array3 != null) { num5 += array3.Length; } ctx.CopyMessagesCount += new CopyMessagesCount(num, num2, num3, num4, num5, skipped); }