// Token: 0x060008FE RID: 2302 RVA: 0x00035AF4 File Offset: 0x00033CF4
        private static void ConvertV7StickyOptions(FolderSyncState syncState)
        {
            XmlNode       xmlNode       = null;
            ByteArrayData byteArrayData = (ByteArrayData)syncState[CustomStateDatumType.CachedOptionsNode];

            if (byteArrayData == null || byteArrayData.Data == null)
            {
                return;
            }
            using (MemoryStream memoryStream = new MemoryStream(byteArrayData.Data))
            {
                using (WbxmlReader wbxmlReader = new WbxmlReader(memoryStream))
                {
                    xmlNode = wbxmlReader.ReadXmlDocument().FirstChild;
                    if (xmlNode == null)
                    {
                        return;
                    }
                }
            }
            using (MemoryStream memoryStream2 = new MemoryStream(50))
            {
                WbxmlWriter wbxmlWriter = new WbxmlWriter(memoryStream2);
                XmlElement  xmlElement  = xmlNode.OwnerDocument.CreateElement("Collection", "AirSync:");
                xmlElement.AppendChild(xmlNode);
                wbxmlWriter.WriteXmlDocumentFromElement(xmlElement);
                syncState[CustomStateDatumType.CachedOptionsNode] = new ByteArrayData(memoryStream2.ToArray());
            }
        }
        // Token: 0x060016D3 RID: 5843 RVA: 0x0008983C File Offset: 0x00087A3C
        public void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            DateTimeData dateTimeDataInstance = componentDataPool.GetDateTimeDataInstance();

            dateTimeDataInstance.DeserializeData(reader, componentDataPool);
            this.ReceivedDateUtc = dateTimeDataInstance.Data;
            ByteArrayData byteArrayInstance = componentDataPool.GetByteArrayInstance();

            byteArrayInstance.DeserializeData(reader, componentDataPool);
            this.IcsState     = byteArrayInstance.Data;
            this.ChangeNumber = reader.ReadInt32();
        }
 protected override void VerifySyncState(Dictionary <string, DerivedData <ICustomSerializableBuilder> > obj)
 {
     base.VerifySyncState(obj);
     if (base.Version >= 1)
     {
         DateTimeData  dateTimeData  = obj["{9150227d-9140-45d0-b4c2-e987f59cfc46}SyncCalendar.OldestReceivedTime"].Data as DateTimeData;
         ByteArrayData byteArrayData = obj["{9150227d-9140-45d0-b4c2-e987f59cfc46}SyncCalendar.LastInstanceKey"].Data as ByteArrayData;
         BooleanData   booleanData   = obj["{9150227d-9140-45d0-b4c2-e987f59cfc46}SyncCalendar.MoreItemsOnServer"].Data as BooleanData;
         if (dateTimeData == null || byteArrayData == null || booleanData == null)
         {
             throw new CorruptSyncStateException("Empty mandatory key", null);
         }
     }
 }
Exemple #4
0
        public override void HandleSyncStateVersioning(SyncState syncState)
        {
            if (syncState == null)
            {
                throw new ArgumentNullException("syncState");
            }
            if (syncState.BackendVersion == null)
            {
                return;
            }
            bool flag = true;

            if (syncState.BackendVersion < 3 || syncState.BackendVersion > this.Version)
            {
                flag = false;
            }
            else if (syncState.BackendVersion.Value != this.Version)
            {
                int value = syncState.BackendVersion.Value;
                switch (value)
                {
                case 3:
                    syncState["ClientCanSendUpEmptyRequests"] = new BooleanData(false);
                    syncState["LastSyncRequestRandomString"]  = new StringData(string.Empty);
                    break;

                case 4:
                    break;

                case 5:
                    goto IL_114;

                default:
                    switch (value)
                    {
                    case 20:
                        goto IL_124;

                    case 21:
                    case 22:
                        goto IL_150;

                    case 23:
                        goto IL_166;

                    case 24:
                        goto IL_172;

                    case 25:
                        goto IL_17D;

                    default:
                        flag = false;
                        goto IL_18C;
                    }
                    break;
                }
                syncState["ClientCanSendUpEmptyRequests"] = new BooleanData(false);
                syncState.Remove("IsXmlValidBool");
IL_114:
                syncState["LastClientIdsSent"] = new GenericListData <StringData, string>();
IL_124:
                syncState["LastCachableWbxmlDocument"]    = new ByteArrayData();
                syncState["ClientCanSendUpEmptyRequests"] = new BooleanData(false);
                syncState.Remove("XmlDocumentString");
IL_150:
                syncState["LastAdUpdateTime"] = syncState.GetData <DateTimeData>("LastAdUpdateTime");
IL_166:
                syncState["ClientCategoryList"] = null;
IL_172:
                syncState.Remove("LastAdUpdateTime");
IL_17D:
                syncState.Remove("MailboxLog");
            }
IL_18C:
            if (!flag)
            {
                syncState.HandleCorruptSyncState();
            }
        }