internal static void ValidateEnumeration(EnumerateHierarchyChangesFlags flags, IHierarchyChangesFetcher hierarchyChangesFetcher, bool hasMoreHierarchyChangesPrevPage, bool isPagedEnumeration) { flags.HasFlag(EnumerateHierarchyChangesFlags.FirstPage); flags.HasFlag(EnumerateHierarchyChangesFlags.Catchup); if (!isPagedEnumeration || flags.HasFlag(EnumerateHierarchyChangesFlags.FirstPage) || flags.HasFlag(EnumerateHierarchyChangesFlags.Catchup)) { return; } }
MailboxChangesManifest ISourceMailbox.EnumerateHierarchyChanges(EnumerateHierarchyChangesFlags flags, int maxChanges) { MrsTracer.Provider.Function("EasSourceMailbox.EnumerateHierarchyChanges(flags:{0}, maxChanges:{1})", new object[] { flags, maxChanges }); bool catchup = flags.HasFlag(EnumerateHierarchyChangesFlags.Catchup); if (catchup) { if (string.IsNullOrEmpty(this.SyncState.HierarchyData.ProviderSyncState) || this.SyncState.HierarchyData.ManualSyncData != null) { base.RefreshFolderCache(); } return(null); } return(this.EnumerateHierarchyChanges(catchup, delegate(SyncHierarchyManifestState hierState) { MailboxChangesManifest result; try { result = this.DoManifestSync(flags, maxChanges, hierState, null); } catch (EasRequiresSyncKeyResetException ex) { MrsTracer.Provider.Error("Encountered RequiresSyncKeyReset error: {0}", new object[] { ex }); result = this.RunManualHierarchySync(catchup, hierState); } return result; })); }
MailboxChangesManifest ISourceMailbox.EnumerateHierarchyChanges(EnumerateHierarchyChangesFlags flags, int maxChanges) { bool catchup = flags.HasFlag(EnumerateHierarchyChangesFlags.Catchup); return(this.EnumerateHierarchyChanges(catchup, delegate(SyncHierarchyManifestState hierarchyData) { bool flag = false; MailboxChangesManifest result; try { IL_02: result = this.DoManifestSync(flags, maxChanges, hierarchyData, this.MapiStore); } catch (MapiExceptionCallFailed mapiExceptionCallFailed) { if (mapiExceptionCallFailed.LowLevelError == 1228 && !flag) { this.ReadRulesFromAllFolders(); flag = true; goto IL_02; } throw; } return result; })); }
protected override MailboxChangesManifest DoManifestSync(EnumerateHierarchyChangesFlags flags, int maxChanges, SyncHierarchyManifestState hierState, MapiStore mapiStore) { MrsTracer.Provider.Function("EasSourceMailbox.DoManifestSync", new object[0]); base.VerifyMailboxConnection(VerifyMailboxConnectionFlags.None); flags.HasFlag(EnumerateHierarchyChangesFlags.Catchup); EasHierarchySyncState easHierarchySyncState = EasHierarchySyncState.Deserialize(hierState.ProviderSyncState); string syncKey = easHierarchySyncState.SyncKey; string syncKey2; IReadOnlyCollection <Add> readOnlyCollection; MailboxChangesManifest folderChangesOnServer = this.GetFolderChangesOnServer(syncKey, out syncKey2, out readOnlyCollection); bool flag = false; easHierarchySyncState.SyncKey = syncKey2; if (folderChangesOnServer.DeletedFolders != null) { List <Add> list = new List <Add>(folderChangesOnServer.DeletedFolders.Count); foreach (Add add in easHierarchySyncState.Folders) { foreach (byte[] entryId in folderChangesOnServer.DeletedFolders) { if (StringComparer.Ordinal.Equals(add.ServerId, EasMailbox.GetStringId(entryId))) { list.Add(add); break; } } } foreach (Add item in list) { easHierarchySyncState.Folders.Remove(item); flag = true; } } if (readOnlyCollection != null) { foreach (Add item2 in readOnlyCollection) { easHierarchySyncState.Folders.Add(item2); flag = true; } } hierState.ProviderSyncState = easHierarchySyncState.Serialize(false); if (flag) { base.RefreshFolderCache(easHierarchySyncState); } return(folderChangesOnServer); }
private void ConfigureMapiManifest(SyncHierarchyManifestState syncState, MailboxChangesManifest changes, EnumerateHierarchyChangesFlags flags, int maxChanges) { if (this.isPagedEnumeration && !flags.HasFlag(EnumerateHierarchyChangesFlags.FirstPage)) { this.callback.InitializeNextPage(changes, maxChanges); return; } this.callback = new ManifestHierarchyCallback(this.isPagedEnumeration); this.callback.InitializeNextPage(changes, maxChanges); SyncConfigFlags syncConfigFlags = SyncConfigFlags.ManifestHierReturnDeletedEntryIds; if (((this.mailbox.ServerVersion >= Server.E14MinVersion && this.mailbox.ServerVersion < Server.E15MinVersion) || (long)this.mailbox.ServerVersion >= ManifestHierarchyChangesFetcher.E15MinVersionSupportsOnlySpecifiedPropsForHierarchy) && !this.mailbox.IsPureMAPI) { syncConfigFlags |= SyncConfigFlags.OnlySpecifiedProps; } using (this.mailbox.RHTracker.Start()) { this.mapiManifest = this.mapiFolder.CreateExportHierarchyManifestEx(syncConfigFlags, syncState.IdsetGiven, syncState.CnsetSeen, this.callback, new PropTag[] { PropTag.EntryId }, null); } }
MailboxChangesManifest ISourceMailbox.EnumerateHierarchyChanges(EnumerateHierarchyChangesFlags flags, int maxChanges) { bool catchup = flags.HasFlag(EnumerateHierarchyChangesFlags.Catchup); return(this.EnumerateHierarchyChanges(catchup, (SyncHierarchyManifestState hierarchyData) => this.RunManualHierarchySync(catchup, hierarchyData))); }
MailboxChangesManifest ISourceMailbox.EnumerateHierarchyChanges(EnumerateHierarchyChangesFlags flags, int maxChanges) { bool catchup = flags.HasFlag(EnumerateHierarchyChangesFlags.Catchup); return(this.EnumerateHierarchyChanges(catchup, (SyncHierarchyManifestState hierarchyData) => this.DoManifestSync(flags, maxChanges, hierarchyData, this.StoreSession.Mailbox.MapiStore))); }
MailboxChangesManifest ISourceMailbox.EnumerateHierarchyChanges(EnumerateHierarchyChangesFlags flags, int maxChanges) { MrsTracer.ProxyClient.Function("RemoteSourceMailbox.EnumerateHierarchyChanges({0}, {1})", new object[] { flags, maxChanges }); base.VerifyMailboxConnection(); if (((IMailbox)this).IsMailboxCapabilitySupported(MailboxCapabilities.PagedEnumerateHierarchyChanges)) { return(base.MrsProxy.ISourceMailbox_EnumerateHierarchyChanges2(base.Handle, (int)flags, maxChanges)); } if (maxChanges != 0) { throw new UnsupportedRemoteServerVersionWithOperationPermanentException(base.MrsProxyClient.ServerName, base.ServerVersion.ToString(), "ISourceMailbox_EnumerateHierarchyChanges2"); } return(base.MrsProxy.ISourceMailbox_EnumerateHierarchyChanges(base.Handle, flags.HasFlag(EnumerateHierarchyChangesFlags.Catchup))); }