Пример #1
0
 // Token: 0x0600056D RID: 1389 RVA: 0x00020424 File Offset: 0x0001E624
 internal void SerializeData(BinaryWriter writer, ComponentDataPool componentDataPool)
 {
     lock (this.instanceLock)
     {
         if (!this.Validate())
         {
             throw new InvalidOperationException("DeviceBehavior data is invalid prior to serialization");
         }
         GenericListData <DateTimeData, ExDateTime> genericListData = new GenericListData <DateTimeData, ExDateTime>(this.userAgentTimes);
         genericListData.SerializeData(writer, componentDataPool);
         GenericListData <StringData, string> genericListData2 = new GenericListData <StringData, string>(this.userAgentStrings);
         genericListData2.SerializeData(writer, componentDataPool);
         GenericListData <DateTimeData, ExDateTime> genericListData3 = new GenericListData <DateTimeData, ExDateTime>(this.recentCommandTimes);
         genericListData3.SerializeData(writer, componentDataPool);
         GenericListData <Int32Data, int> genericListData4 = new GenericListData <Int32Data, int>(this.recentCommandHashCodes);
         genericListData4.SerializeData(writer, componentDataPool);
         GenericListData <DateTimeData, ExDateTime> genericListData5 = new GenericListData <DateTimeData, ExDateTime>(this.watsons);
         genericListData5.SerializeData(writer, componentDataPool);
         GenericListData <DateTimeData, ExDateTime> genericListData6 = new GenericListData <DateTimeData, ExDateTime>(this.outOfBudgets);
         genericListData6.SerializeData(writer, componentDataPool);
         GenericListData <DateTimeData, ExDateTime> genericListData7 = new GenericListData <DateTimeData, ExDateTime>(this.syncTimes);
         genericListData7.SerializeData(writer, componentDataPool);
         GenericListData <Int32Data, int> genericListData8 = new GenericListData <Int32Data, int>(this.syncKeys);
         genericListData8.SerializeData(writer, componentDataPool);
         componentDataPool.GetDateTimeDataInstance().Bind(this.blockTime).SerializeData(writer, componentDataPool);
         componentDataPool.GetDateTimeDataInstance().Bind(this.nextUnblockTime).SerializeData(writer, componentDataPool);
         componentDataPool.GetInt32DataInstance().Bind((int)this.autoBlockReason).SerializeData(writer, componentDataPool);
         componentDataPool.GetDateTimeDataInstance().Bind(this.timeToUpdateAD).SerializeData(writer, componentDataPool);
     }
 }
Пример #2
0
            public void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
            {
                GenericListData <DerivedData <ISyncItemId>, ISyncItemId> genericListData = new GenericListData <DerivedData <ISyncItemId>, ISyncItemId>();

                genericListData.DeserializeData(reader, componentDataPool);
                this.Ocurrences = genericListData.Data;
            }
Пример #3
0
            public void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
            {
                DerivedData <ISyncItemId> derivedData = new DerivedData <ISyncItemId>();

                derivedData.DeserializeData(reader, componentDataPool);
                this.ParentId = derivedData.Data;
                GenericListData <DerivedData <ISyncItemId>, ISyncItemId> genericListData = new GenericListData <DerivedData <ISyncItemId>, ISyncItemId>();

                genericListData.DeserializeData(reader, componentDataPool);
                this.Children = genericListData.Data;
                BooleanData booleanDataInstance = componentDataPool.GetBooleanDataInstance();

                booleanDataInstance.DeserializeData(reader, componentDataPool);
                this.hidden = booleanDataInstance.Data;
                booleanDataInstance.DeserializeData(reader, componentDataPool);
                this.HiddenDueToParent = booleanDataInstance.Data;
                Int32Data int32DataInstance = componentDataPool.GetInt32DataInstance();

                int32DataInstance.DeserializeData(reader, componentDataPool);
                this.Permissions = (SyncPermissions)int32DataInstance.Data;
                StringData stringDataInstance = componentDataPool.GetStringDataInstance();

                stringDataInstance.DeserializeData(reader, componentDataPool);
                this.Owner = stringDataInstance.Data;
            }
        // Token: 0x060017A2 RID: 6050 RVA: 0x0008C4CC File Offset: 0x0008A6CC
        private List <string> GetLastIdsSeen()
        {
            GenericListData <StringData, string> genericListData = this.syncStatusSyncState[CustomStateDatumType.LastClientIdsSent] as GenericListData <StringData, string>;

            if (genericListData == null || genericListData.Data == null)
            {
                return(null);
            }
            return(genericListData.Data);
        }
        // Token: 0x060017A1 RID: 6049 RVA: 0x0008C494 File Offset: 0x0008A694
        private List <int> GetClientCategoryList()
        {
            GenericListData <Int32Data, int> genericListData = this.syncStatusSyncState[CustomStateDatumType.ClientCategoryList] as GenericListData <Int32Data, int>;

            if (genericListData == null || genericListData.Data == null)
            {
                return(null);
            }
            return(genericListData.Data);
        }
Пример #6
0
			// Token: 0x0600092F RID: 2351 RVA: 0x00036498 File Offset: 0x00034698
			public void SerializeData(BinaryWriter writer, ComponentDataPool componentDataPool)
			{
				DerivedData<ISyncItemId> derivedData = new DerivedData<ISyncItemId>(this.ParentId);
				derivedData.SerializeData(writer, componentDataPool);
				GenericListData<DerivedData<ISyncItemId>, ISyncItemId> genericListData = new GenericListData<DerivedData<ISyncItemId>, ISyncItemId>(this.Children);
				genericListData.SerializeData(writer, componentDataPool);
				componentDataPool.GetBooleanDataInstance().Bind(this.hidden).SerializeData(writer, componentDataPool);
				componentDataPool.GetBooleanDataInstance().Bind(this.HiddenDueToParent).SerializeData(writer, componentDataPool);
				componentDataPool.GetInt32DataInstance().Bind((int)this.Permissions).SerializeData(writer, componentDataPool);
				componentDataPool.GetStringDataInstance().Bind(this.Owner).SerializeData(writer, componentDataPool);
			}
Пример #7
0
 // Token: 0x0600056E RID: 1390 RVA: 0x0002058C File Offset: 0x0001E78C
 internal void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
 {
     lock (this.instanceLock)
     {
         GenericListData <DateTimeData, ExDateTime> genericListData = new GenericListData <DateTimeData, ExDateTime>();
         genericListData.DeserializeData(reader, componentDataPool);
         this.userAgentTimes = genericListData.Data;
         GenericListData <StringData, string> genericListData2 = new GenericListData <StringData, string>();
         genericListData2.DeserializeData(reader, componentDataPool);
         this.userAgentStrings = genericListData2.Data;
         GenericListData <DateTimeData, ExDateTime> genericListData3 = new GenericListData <DateTimeData, ExDateTime>();
         genericListData3.DeserializeData(reader, componentDataPool);
         this.recentCommandTimes = genericListData3.Data;
         GenericListData <Int32Data, int> genericListData4 = new GenericListData <Int32Data, int>();
         genericListData4.DeserializeData(reader, componentDataPool);
         this.recentCommandHashCodes = genericListData4.Data;
         GenericListData <DateTimeData, ExDateTime> genericListData5 = new GenericListData <DateTimeData, ExDateTime>();
         genericListData5.DeserializeData(reader, componentDataPool);
         this.watsons = genericListData5.Data;
         GenericListData <DateTimeData, ExDateTime> genericListData6 = new GenericListData <DateTimeData, ExDateTime>();
         genericListData6.DeserializeData(reader, componentDataPool);
         this.outOfBudgets = genericListData6.Data;
         GenericListData <DateTimeData, ExDateTime> genericListData7 = new GenericListData <DateTimeData, ExDateTime>();
         genericListData7.DeserializeData(reader, componentDataPool);
         this.syncTimes = genericListData7.Data;
         GenericListData <Int32Data, int> genericListData8 = new GenericListData <Int32Data, int>();
         genericListData8.DeserializeData(reader, componentDataPool);
         this.syncKeys = genericListData8.Data;
         DateTimeData dateTimeDataInstance = componentDataPool.GetDateTimeDataInstance();
         dateTimeDataInstance.DeserializeData(reader, componentDataPool);
         this.blockTime = dateTimeDataInstance.Data;
         DateTimeData dateTimeDataInstance2 = componentDataPool.GetDateTimeDataInstance();
         dateTimeDataInstance2.DeserializeData(reader, componentDataPool);
         this.nextUnblockTime = dateTimeDataInstance2.Data;
         Int32Data int32DataInstance = componentDataPool.GetInt32DataInstance();
         int32DataInstance.DeserializeData(reader, componentDataPool);
         this.autoBlockReason = (DeviceAccessStateReason)int32DataInstance.Data;
         DateTimeData dateTimeDataInstance3 = componentDataPool.GetDateTimeDataInstance();
         dateTimeDataInstance3.DeserializeData(reader, componentDataPool);
         this.timeToUpdateAD = dateTimeDataInstance3.Data;
         if (!this.Validate())
         {
             throw new CorruptSyncStateException(new LocalizedString("DeviceBehavior.DeserializeData"), null);
         }
     }
 }
Пример #8
0
        // Token: 0x060008E7 RID: 2279 RVA: 0x00035378 File Offset: 0x00033578
        public virtual void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            if (componentDataPool.ExternalVersion < 1)
            {
                GenericDictionaryData <StringData, string, StoreObjectIdData, StoreObjectId> genericDictionaryData = new GenericDictionaryData <StringData, string, StoreObjectIdData, StoreObjectId>();
                genericDictionaryData.DeserializeData(reader, componentDataPool);
                Dictionary <string, StoreObjectId> data = genericDictionaryData.Data;
                this.syncIdToMailboxIdTable = new Dictionary <string, ISyncItemId>(data.Count);
                using (Dictionary <string, StoreObjectId> .Enumerator enumerator = data.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        KeyValuePair <string, StoreObjectId> keyValuePair = enumerator.Current;
                        this.syncIdToMailboxIdTable[keyValuePair.Key] = MailboxSyncItemId.CreateForNewItem(keyValuePair.Value);
                    }
                    goto IL_92;
                }
            }
            GenericDictionaryData <StringData, string, DerivedData <ISyncItemId>, ISyncItemId> genericDictionaryData2 = new GenericDictionaryData <StringData, string, DerivedData <ISyncItemId>, ISyncItemId>();

            genericDictionaryData2.DeserializeData(reader, componentDataPool);
            this.syncIdToMailboxIdTable = genericDictionaryData2.Data;
IL_92:
            this.mailboxIdToSyncIdTable = new Dictionary <ISyncItemId, string>(this.syncIdToMailboxIdTable.Count);
            foreach (KeyValuePair <string, ISyncItemId> keyValuePair2 in this.syncIdToMailboxIdTable)
            {
                this.mailboxIdToSyncIdTable.Add(keyValuePair2.Value, keyValuePair2.Key);
            }
            GenericListData <StringData, string> genericListData = new GenericListData <StringData, string>();

            genericListData.DeserializeData(reader, componentDataPool);
            this.deletedItems = genericListData.Data;
            genericListData.DeserializeData(reader, componentDataPool);
            this.addedItems    = genericListData.Data;
            this.uniqueCounter = reader.ReadInt64();
        }
Пример #9
0
            public void SerializeData(BinaryWriter writer, ComponentDataPool componentDataPool)
            {
                GenericListData <DerivedData <ISyncItemId>, ISyncItemId> genericListData = new GenericListData <DerivedData <ISyncItemId>, ISyncItemId>(this.Ocurrences);

                genericListData.SerializeData(writer, componentDataPool);
            }
Пример #10
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();
            }
        }