コード例 #1
0
 // Token: 0x0600184E RID: 6222 RVA: 0x0008E9FC File Offset: 0x0008CBFC
 private void UpdateFilter(Dictionary <StoreObjectId, string> mapping, DateTimeCustomSyncFilter dateTimeFilter, Dictionary <string, CommonNode> items)
 {
     foreach (StoreObjectId storeObjectId in mapping.Keys)
     {
         string      key        = mapping[storeObjectId];
         CommonNode  commonNode = items[key];
         ISyncItemId syncItemId = MailboxSyncItemId.CreateForNewItem(storeObjectId);
         if (commonNode.IsCalendar)
         {
             dateTimeFilter.UpdateFilterStateWithAddOrChange(syncItemId, true, true, commonNode.EndTime);
         }
         ChangeTrackingNode[] array;
         if (commonNode.IsEmail)
         {
             array = new ChangeTrackingNode[]
             {
                 ChangeTrackingNode.AllOtherNodes,
                 new ChangeTrackingNode("Email", "Read")
             };
         }
         else
         {
             array = new ChangeTrackingNode[]
             {
                 ChangeTrackingNode.AllNodes
             };
         }
         GenericDictionaryData <DerivedData <ISyncItemId>, ISyncItemId, FolderSync.ClientStateInformation> genericDictionaryData = (GenericDictionaryData <DerivedData <ISyncItemId>, ISyncItemId, FolderSync.ClientStateInformation>) this.syncState[SyncStateProp.ClientState];
         if (!genericDictionaryData.Data.ContainsKey(syncItemId))
         {
             genericDictionaryData.Data[syncItemId] = new FolderSync.ClientStateInformation();
         }
         FolderSync.ClientStateInformation clientStateInformation = genericDictionaryData.Data[syncItemId];
         clientStateInformation.ChangeTrackingInformation = new int?[array.Length];
         clientStateInformation.ClientHasItem             = true;
     }
 }
コード例 #2
0
        // Token: 0x0600184C RID: 6220 RVA: 0x0008E670 File Offset: 0x0008C870
        public bool Upgrade(StoreObjectId storeId, Dictionary <string, CommonNode> items, Dictionary <string, string> mapping, List <TagNode> tags, StoreObjectType type, string synckeyIn, string shortParentId, int nextShortId, uint version)
        {
            if (storeId == null)
            {
                AirSyncDiagnostics.TraceDebug(ExTraceGlobals.TiUpgradeTracer, this, "Input to TiSyncUpgrade.Upgrade is null: field storeId");
                throw new ArgumentNullException("storeId");
            }
            if (items == null)
            {
                AirSyncDiagnostics.TraceDebug(ExTraceGlobals.TiUpgradeTracer, this, "Input to TiSyncUpgrade.Upgrade is null: field items");
                throw new ArgumentNullException("items");
            }
            if (mapping == null)
            {
                AirSyncDiagnostics.TraceDebug(ExTraceGlobals.TiUpgradeTracer, this, "Input to TiSyncUpgrade.Upgrade is null: field mapping");
                throw new ArgumentNullException("mapping");
            }
            if (tags == null)
            {
                AirSyncDiagnostics.TraceDebug(ExTraceGlobals.TiUpgradeTracer, this, "Input to TiSyncUpgrade.Upgrade is null: field tags");
                throw new ArgumentNullException("tags");
            }
            if (synckeyIn == null)
            {
                AirSyncDiagnostics.TraceDebug(ExTraceGlobals.TiUpgradeTracer, this, "Input to TiSyncUpgrade.Upgrade is null: field synckeyIn");
                throw new ArgumentNullException("synckeyIn");
            }
            if (shortParentId == null && mapping.Count > 0)
            {
                AirSyncDiagnostics.TraceDebug(ExTraceGlobals.TiUpgradeTracer, this, "Input to TiSyncUpgrade.Upgrade is null: field shortParentId, and mapping.Count > 0");
                throw new ArgumentNullException("shortParentId");
            }
            Dictionary <StoreObjectId, string> dictionary = new Dictionary <StoreObjectId, string>();

            this.storeId = storeId;
            try
            {
                this.LoadE12SyncState(storeId, shortParentId, nextShortId);
                Folder sourceFolder = null;
                try
                {
                    sourceFolder = Folder.Bind(this.mailboxSession, storeId, null);
                }
                catch (ObjectNotFoundException)
                {
                    return(false);
                }
                if (!TiSyncUpgrade.ParseSupportedTags((int)version, tags, type))
                {
                    return(false);
                }
                Dictionary <string, CommonNode> items2 = new Dictionary <string, CommonNode>(items);
                ItemSyncUpgrade itemSyncUpgrade        = new ItemSyncUpgrade();
                dictionary = itemSyncUpgrade.Upgrade(this.syncState, items, sourceFolder, this.mailboxSession);
                if (dictionary == null)
                {
                    return(false);
                }
                DateTimeCustomSyncFilter dateTimeFilter = new DateTimeCustomSyncFilter(this.syncState);
                this.UpdateFilter(dictionary, dateTimeFilter, items2);
                this.UpdateMapping(dictionary, mapping);
                this.syncState[CustomStateDatumType.AirSyncProtocolVersion] = new Int32Data((int)version);
                ((ItemIdMapping)this.syncState[CustomStateDatumType.IdMapping]).CommitChanges();
                string text = synckeyIn;
                int    num  = text.LastIndexOf("}");
                if (num >= 0)
                {
                    text = text.Substring(num + 1, text.Length - num - 1);
                }
                uint data = (uint)int.Parse(text, CultureInfo.InvariantCulture);
                this.syncState[CustomStateDatumType.SyncKey] = new UInt32Data(data);
                this.syncState.Commit();
            }
            finally
            {
                if (this.syncState != null)
                {
                    this.syncState.Dispose();
                }
            }
            return(true);
        }