Esempio n. 1
0
        // Token: 0x060015CA RID: 5578 RVA: 0x00080E1C File Offset: 0x0007F01C
        protected void Load(string base64SyncData)
        {
            byte[] array = SyncCalendarSyncStateBase.ConvertBase64SyncStateData(base64SyncData);
            ExTraceGlobals.MethodEnterExitTracer.TraceDebug((long)this.GetHashCode(), "SyncCalendarSyncStateBase.Load called.");
            GenericDictionaryData <StringData, string, DerivedData <ICustomSerializableBuilder> > genericDictionaryData = null;

            try
            {
                if (array != null && array.Length > 0)
                {
                    using (MemoryStream memoryStream = new MemoryStream(array))
                    {
                        using (MemoryStream memoryStream2 = new MemoryStream())
                        {
                            using (BinaryReader binaryReader = new BinaryReader(memoryStream2))
                            {
                                ComponentDataPool componentDataPool = new ComponentDataPool();
                                byte[]            transferBuffer    = new byte[71680];
                                SerializationHelper.Decompress(memoryStream, memoryStream2, transferBuffer);
                                memoryStream2.Seek(0L, SeekOrigin.Begin);
                                GenericDictionaryData <StringData, string, DerivedData <ICustomSerializableBuilder> > genericDictionaryData2 = new GenericDictionaryData <StringData, string, DerivedData <ICustomSerializableBuilder> >();
                                genericDictionaryData2.DeserializeData(binaryReader, componentDataPool);
                                genericDictionaryData = genericDictionaryData2;
                            }
                        }
                    }
                    if (genericDictionaryData == null)
                    {
                        throw new CorruptSyncStateException("No SyncStateDictionaryData", null);
                    }
                }
                else
                {
                    genericDictionaryData = new GenericDictionaryData <StringData, string, DerivedData <ICustomSerializableBuilder> >(new Dictionary <string, DerivedData <ICustomSerializableBuilder> >());
                    this.InitializeSyncState(genericDictionaryData.Data);
                }
                this.VerifySyncState(genericDictionaryData.Data);
            }
            catch (CustomSerializationException innerException)
            {
                throw new CorruptSyncStateException("SyncCalendarSyncStateBase.Load caught", innerException);
            }
            catch (ArgumentException innerException2)
            {
                throw new CorruptSyncStateException("SyncCalendarSyncStateBase.Load caught", innerException2);
            }
            catch (EndOfStreamException innerException3)
            {
                throw new CorruptSyncStateException("SyncCalendarSyncStateBase.Load caught", innerException3);
            }
            this.syncStateTable = genericDictionaryData;
            ExTraceGlobals.MethodEnterExitTracer.TraceDebug((long)this.GetHashCode(), "SyncCalendarSyncStateBase.Load successful.");
        }