Esempio n. 1
0
        internal static void HandlerCustomDataVersioning(FolderSyncState syncState)
        {
            if (syncState == null)
            {
                throw new ArgumentNullException("syncState");
            }
            if (syncState.CustomVersion == null && syncState.SyncStateIsNew)
            {
                return;
            }
            bool flag = true;

            if (syncState.CustomVersion == null || syncState.CustomVersion <= 2 || syncState.CustomVersion > 9)
            {
                flag = false;
            }
            else if (syncState.CustomVersion.Value != 9)
            {
                switch (syncState.CustomVersion.Value)
                {
                case 3:
                    syncState["CachedOptionsNode"] = null;
                    break;

                case 4:
                    break;

                case 5:
                    goto IL_117;

                case 6:
                    goto IL_12C;

                case 7:
                    goto IL_13D;

                case 8:
                    goto IL_143;

                default:
                    flag = false;
                    goto IL_158;
                }
                object obj = syncState[CustomStateDatumType.AirSyncProtocolVersion];
                if (obj is ConstStringData)
                {
                    string data  = syncState.GetData <ConstStringData, string>(CustomStateDatumType.AirSyncProtocolVersion, null);
                    int    data2 = 20;
                    if (data != null)
                    {
                        data2 = AirSyncUtility.ParseVersionString(data);
                    }
                    syncState[CustomStateDatumType.AirSyncProtocolVersion] = new Int32Data(data2);
                }
IL_117:
                syncState["MaxItems"] = new Int32Data(int.MaxValue);
IL_12C:
                syncState["ConversationMode"] = new BooleanData(false);
IL_13D:
                FolderSyncStateCustomDataInfo.ConvertV7StickyOptions(syncState);
IL_143:
                syncState["Permissions"] = new Int32Data(0);
            }
IL_158:
            if (!flag)
            {
                syncState.HandleCorruptSyncState();
            }
        }