Пример #1
0
        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);
        }
Пример #2
0
        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();
                }
            }
        }