Beispiel #1
0
        public void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            StoreObjectIdData storeObjectIdDataInstance = componentDataPool.GetStoreObjectIdDataInstance();

            storeObjectIdDataInstance.DeserializeData(reader, componentDataPool);
            this.internalItemId = storeObjectIdDataInstance.Data;
            storeObjectIdDataInstance.DeserializeData(reader, componentDataPool);
            this.parentId   = storeObjectIdDataInstance.Data;
            this.changeType = (ChangeType)reader.ReadInt32();
            ByteArrayData byteArrayInstance = componentDataPool.GetByteArrayInstance();

            byteArrayInstance.DeserializeData(reader, componentDataPool);
            this.changeKey          = byteArrayInstance.Data;
            this.changeTrackingHash = reader.ReadInt32();
            if (componentDataPool.InternalVersion > 1)
            {
                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;
                BooleanData booleanDataInstance = componentDataPool.GetBooleanDataInstance();
                booleanDataInstance.DeserializeData(reader, componentDataPool);
                this.Hidden = booleanDataInstance.Data;
            }
        }
Beispiel #2
0
        public void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            StoreObjectIdData storeObjectIdDataInstance = componentDataPool.GetStoreObjectIdDataInstance();

            storeObjectIdDataInstance.DeserializeData(reader, componentDataPool);
            this.nativeId = storeObjectIdDataInstance.Data;
        }
Beispiel #3
0
        public override void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            if (reader.ReadBoolean())
            {
                base.Data = null;
                return;
            }
            int num  = reader.ReadInt32();
            int num2 = num;

            try
            {
                bool flag = false;
                ExTraceGlobals.FaultInjectionTracer.TraceTest <bool>(2902863165U, ref flag);
                if (flag)
                {
                    num2 = int.MaxValue;
                    throw new OutOfMemoryException();
                }
                base.Data = new List <RawT>(num2);
            }
            catch (OutOfMemoryException ex)
            {
                ex.Data["GenericListDataDeserializationCount"] = num2;
                throw;
            }
            for (int i = 0; i < num; i++)
            {
                this.serializableData.DeserializeData(reader, componentDataPool);
                base.Data.Add(this.serializableData.Data);
            }
        }
Beispiel #4
0
        protected override void ProcessStream(BinaryReader reader, ComponentDataPool componentDataPool, out uint hashCode, out int startIndex, out int length)
        {
            MemoryStream memoryStream = (MemoryStream)componentDataPool.ConstStringDataReader.BaseStream;

            memoryStream.Seek(0L, SeekOrigin.Begin);
            length = this.Read7BitEncodedInt(reader, memoryStream);
            if (length < 0)
            {
                throw new FormatException("size tag should >= 0");
            }
            startIndex = (int)memoryStream.Position;
            memoryStream.SetLength((long)(startIndex + length));
            byte[] copyBuffer = componentDataPool.CopyBuffer;
            int    num;

            for (int i = length; i > 0; i -= num)
            {
                num = ((i > copyBuffer.Length) ? copyBuffer.Length : i);
                if (reader.Read(copyBuffer, 0, num) != num)
                {
                    throw new FormatException("there are less bytes than what tag says");
                }
                memoryStream.Write(copyBuffer, 0, num);
            }
            hashCode = ComputeCRC.Compute(0U, memoryStream.GetBuffer(), startIndex, length);
        }
        public override void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            if (reader.ReadBoolean())
            {
                base.Data = null;
                return;
            }
            GenericListData <K, RawK> genericListData  = new GenericListData <K, RawK>();
            GenericListData <V>       genericListData2 = new GenericListData <V>();

            genericListData.DeserializeData(reader, componentDataPool);
            genericListData2.DeserializeData(reader, componentDataPool);
            if (genericListData.Data == null)
            {
                base.Data = null;
                return;
            }
            base.Data = new Dictionary <RawK, RawV>(genericListData.Data.Count);
            for (int i = 0; i < genericListData.Data.Count; i++)
            {
                Dictionary <RawK, RawV> data = base.Data;
                RawK key = genericListData.Data[i];
                V    v   = genericListData2.Data[i];
                data[key] = v.Data;
            }
        }
Beispiel #6
0
        public void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            ByteArrayData byteArrayInstance = componentDataPool.GetByteArrayInstance();

            byteArrayInstance.DeserializeData(reader, componentDataPool);
            this.icsState     = byteArrayInstance.Data;
            this.changeNumber = reader.ReadInt32();
        }
Beispiel #7
0
 public override void SerializeData(BinaryWriter writer, ComponentDataPool componentDataPool)
 {
     writer.Write(base.Data == null);
     if (base.Data == null)
     {
         return;
     }
     componentDataPool.GetByteArrayInstance().Bind(base.Data.GetBytes()).SerializeData(writer, componentDataPool);
 }
        public override void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            base.DeserializeData(reader, componentDataPool);
            StringData stringDataInstance = componentDataPool.GetStringDataInstance();

            stringDataInstance.DeserializeData(reader, componentDataPool);
            this.clientAddId       = stringDataInstance.Data;
            this.softDeletePending = reader.ReadBoolean();
        }
 public override void SerializeData(BinaryWriter writer, ComponentDataPool componentDataPool)
 {
     byte[] data = null;
     if (base.Data != null)
     {
         data = base.Data.GetBytes();
     }
     componentDataPool.GetByteArrayInstance().Bind(data).SerializeData(writer, componentDataPool);
 }
Beispiel #10
0
 public override void SerializeData(BinaryWriter writer, ComponentDataPool componentDataPool)
 {
     writer.Write(base.Data == null);
     if (base.Data == null)
     {
         return;
     }
     writer.Write(base.Data);
 }
Beispiel #11
0
 public override void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
 {
     if (reader.ReadBoolean())
     {
         base.Data = null;
         return;
     }
     base.Data = reader.ReadString();
 }
Beispiel #12
0
 public override void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
 {
     if (reader.ReadBoolean())
     {
         base.Data = null;
         return;
     }
     this.serializableData.DeserializeData(reader, componentDataPool);
     base.Data = new RawT?(this.serializableData.Data);
 }
Beispiel #13
0
 public void SerializeData(BinaryWriter writer, ComponentDataPool componentDataPool)
 {
     componentDataPool.GetStoreObjectIdDataInstance().Bind(this.internalItemId).SerializeData(writer, componentDataPool);
     componentDataPool.GetStoreObjectIdDataInstance().Bind(this.parentId).SerializeData(writer, componentDataPool);
     writer.Write((int)this.changeType);
     componentDataPool.GetByteArrayInstance().Bind(this.changeKey).SerializeData(writer, componentDataPool);
     writer.Write(this.changeTrackingHash);
     componentDataPool.GetInt32DataInstance().Bind((int)this.Permissions).SerializeData(writer, componentDataPool);
     componentDataPool.GetStringDataInstance().Bind(this.Owner).SerializeData(writer, componentDataPool);
     componentDataPool.GetBooleanDataInstance().Bind(this.Hidden).SerializeData(writer, componentDataPool);
 }
Beispiel #14
0
 public override void SerializeData(BinaryWriter writer, ComponentDataPool componentDataPool)
 {
     writer.Write(base.Data == null);
     if (base.Data == null)
     {
         return;
     }
     writer.Write(false);
     writer.Write(base.Data.GetByteArrayLength());
     StoreObjectId.Serialize(base.Data, writer);
 }
Beispiel #15
0
        public override void SerializeData(BinaryWriter writer, ComponentDataPool componentDataPool)
        {
            writer.Write(base.Data == null);
            if (base.Data == null)
            {
                return;
            }
            RawT value = base.Data.Value;

            this.serializableData.Bind(value);
            this.serializableData.SerializeData(writer, componentDataPool);
        }
        public void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            StoreObjectIdData storeObjectIdDataInstance = componentDataPool.GetStoreObjectIdDataInstance();

            storeObjectIdDataInstance.DeserializeData(reader, componentDataPool);
            this.parentId = storeObjectIdDataInstance.Data;
            ByteArrayData byteArrayInstance = componentDataPool.GetByteArrayInstance();

            byteArrayInstance.DeserializeData(reader, componentDataPool);
            this.changeKey          = byteArrayInstance.Data;
            this.changeTrackingHash = reader.ReadInt32();
        }
        public override void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            ByteArrayData byteArrayInstance = componentDataPool.GetByteArrayInstance();

            byteArrayInstance.DeserializeData(reader, componentDataPool);
            if (byteArrayInstance.Data == null)
            {
                base.Data = null;
                return;
            }
            base.Data = ConversationId.Create(byteArrayInstance.Data);
        }
Beispiel #18
0
        public override void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            if (reader.ReadBoolean())
            {
                base.Data = null;
                return;
            }
            int num = reader.ReadInt32();

            base.Data = new byte[num];
            reader.Read(base.Data, 0, num);
        }
Beispiel #19
0
        public override void SerializeData(BinaryWriter writer, ComponentDataPool componentDataPool)
        {
            writer.Write(base.Data == null);
            if (base.Data == null)
            {
                return;
            }
            RefT data = base.Data;

            writer.Write(data.TypeId);
            RefT data2 = base.Data;

            data2.SerializeData(writer, componentDataPool);
        }
Beispiel #20
0
 public override void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
 {
     if (reader.ReadBoolean())
     {
         base.Data = null;
         return;
     }
     base.Data = StaticStringPool.Instance.GetData(reader, componentDataPool);
     if (base.Data == null)
     {
         componentDataPool.ConstStringDataReader.BaseStream.Seek(0L, SeekOrigin.Begin);
         base.Data = componentDataPool.ConstStringDataReader.ReadString();
     }
 }
Beispiel #21
0
 public override void SerializeData(BinaryWriter writer, ComponentDataPool componentDataPool)
 {
     writer.Write(base.Data == null);
     if (base.Data == null)
     {
         return;
     }
     writer.Write(base.Data.Count);
     for (int i = 0; i < base.Data.Count; i++)
     {
         this.serializableData.Bind(base.Data[i]);
         this.serializableData.SerializeData(writer, componentDataPool);
     }
 }
Beispiel #22
0
        public DataType GetData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }
            uint hashCode;
            int  startIndex;
            int  length;

            this.ProcessStream(reader, componentDataPool, out hashCode, out startIndex, out length);
            MemoryStream memoryStream = (MemoryStream)componentDataPool.ConstStringDataReader.BaseStream;

            return(this.GetData(hashCode, memoryStream.GetBuffer(), startIndex, length));
        }
        public override void SerializeData(BinaryWriter writer, ComponentDataPool componentDataPool)
        {
            writer.Write(base.Data == null);
            if (base.Data == null)
            {
                return;
            }
            List <RawK> data  = new List <RawK>(base.Data.Keys);
            List <RawV> data2 = new List <RawV>(base.Data.Values);
            GenericListData <K, RawK> genericListData  = new GenericListData <K, RawK>(data);
            GenericListData <V, RawV> genericListData2 = new GenericListData <V, RawV>(data2);

            genericListData.SerializeData(writer, componentDataPool);
            genericListData2.SerializeData(writer, componentDataPool);
        }
Beispiel #24
0
        public override void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            if (reader.ReadBoolean())
            {
                base.Data = null;
                return;
            }
            if (reader.ReadBoolean())
            {
                base.Data = null;
                return;
            }
            int byteArrayLength = reader.ReadInt32();

            base.Data = StoreObjectId.Deserialize(reader, byteArrayLength);
        }
Beispiel #25
0
        public override void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            if (reader.ReadBoolean())
            {
                base.Data = null;
                return;
            }
            int num = reader.ReadInt32();

            base.Data = new RawT[num];
            for (int i = 0; i < num; i++)
            {
                this.serializableData.DeserializeData(reader, componentDataPool);
                base.Data[i] = this.serializableData.Data;
            }
        }
Beispiel #26
0
        public override void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            if (reader.ReadBoolean())
            {
                base.Data = null;
                return;
            }
            ByteArrayData byteArrayInstance = componentDataPool.GetByteArrayInstance();

            byteArrayInstance.DeserializeData(reader, componentDataPool);
            if (byteArrayInstance.Data == null)
            {
                base.Data = null;
                return;
            }
            base.Data = new ADObjectId(byteArrayInstance.Data);
        }
Beispiel #27
0
        public override void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            if (reader.ReadBoolean())
            {
                base.Data = default(RefT);
                return;
            }
            ushort num = reader.ReadUInt16();

            if (!SyncStateTypeFactory.DoesTypeExistWithThisId(num))
            {
                throw new CustomSerializationException(ServerStrings.ExSyncStateCorrupted("Type " + num.ToString() + " not registered."));
            }
            base.Data = (RefT)((object)SyncStateTypeFactory.GetInstance().BuildObject(num));
            RefT data = base.Data;

            data.DeserializeData(reader, componentDataPool);
        }
        public virtual void SerializeData(BinaryWriter writer, ComponentDataPool componentDataPool)
        {
            componentDataPool.GetISyncItemIdDataInstance().Bind(this.itemId).SerializeData(writer, componentDataPool);
            writer.Write((byte)this.changeType);
            ICustomClonable customClonable = this.watermark as ICustomClonable;

            if (customClonable != null)
            {
                this.watermark = (ISyncWatermark)customClonable.CustomClone();
            }
            componentDataPool.GetISyncWatermarkDataInstance().Bind(this.watermark).SerializeData(writer, componentDataPool);
            writer.Write(this.IsAcknowledgedByClient);
            componentDataPool.GetNullableInt32ArrayInstance().Bind(this.changeTrackingInformation).SerializeData(writer, componentDataPool);
            writer.Write(this.IsRejected);
            writer.Write(this.IsDelayedServerOperation);
            componentDataPool.GetNullableDateTimeDataInstance().Bind(this.filterDate).SerializeData(writer, componentDataPool);
            componentDataPool.GetStringDataInstance().Bind(this.messageClass).SerializeData(writer, componentDataPool);
            componentDataPool.GetConversationIdDataInstance().Bind(this.conversationId).SerializeData(writer, componentDataPool);
            writer.Write(this.FirstMessageInConversation);
            writer.Write((byte)this.itemRead);
        }
        public virtual void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
        {
            DerivedData <ISyncItemId> isyncItemIdDataInstance = componentDataPool.GetISyncItemIdDataInstance();

            isyncItemIdDataInstance.DeserializeData(reader, componentDataPool);
            this.itemId     = isyncItemIdDataInstance.Data;
            this.changeType = (ChangeType)reader.ReadByte();
            DerivedData <ISyncWatermark> isyncWatermarkDataInstance = componentDataPool.GetISyncWatermarkDataInstance();

            isyncWatermarkDataInstance.DeserializeData(reader, componentDataPool);
            this.watermark = isyncWatermarkDataInstance.Data;
            this.IsAcknowledgedByClient = reader.ReadBoolean();
            ArrayData <NullableData <Int32Data, int>, int?> nullableInt32ArrayInstance = componentDataPool.GetNullableInt32ArrayInstance();

            nullableInt32ArrayInstance.DeserializeData(reader, componentDataPool);
            this.changeTrackingInformation = nullableInt32ArrayInstance.Data;
            this.IsRejected = reader.ReadBoolean();
            this.IsDelayedServerOperation = reader.ReadBoolean();
            if (componentDataPool.InternalVersion > 0)
            {
                NullableDateTimeData nullableDateTimeDataInstance = componentDataPool.GetNullableDateTimeDataInstance();
                nullableDateTimeDataInstance.DeserializeData(reader, componentDataPool);
                this.filterDate = nullableDateTimeDataInstance.Data;
                StringData stringDataInstance = componentDataPool.GetStringDataInstance();
                stringDataInstance.DeserializeData(reader, componentDataPool);
                this.messageClass = stringDataInstance.Data;
                ConversationIdData conversationIdDataInstance = componentDataPool.GetConversationIdDataInstance();
                conversationIdDataInstance.DeserializeData(reader, componentDataPool);
                this.conversationId             = conversationIdDataInstance.Data;
                this.FirstMessageInConversation = reader.ReadBoolean();
                if (componentDataPool.InternalVersion > 2)
                {
                    this.itemRead = (ServerManifestEntry.ReadFlagState)reader.ReadByte();
                }
            }
        }
Beispiel #30
0
 public override void DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
 {
     base.Data = reader.ReadUInt32();
 }