Example #1
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexDataItem List
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                IndexDataItem indexDataItem;
                for (ushort i = 0; i < count; i++)
                {
                    if (reader.ReadBoolean())
                    {
                        indexDataItem = new IndexDataItem();
                        Serializer.Deserialize(reader.BaseStream, indexDataItem);
                        Add(indexDataItem);
                    }
                }

                //IndexId
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    IndexId = reader.ReadBytes(len);
                }

                //IndexSize
                IndexSize = reader.ReadInt32();

                //IndexExists
                IndexExists = reader.ReadBoolean();

                //IndexCap
                IndexCap = reader.ReadInt32();
            }
        }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexExists
            IndexExists = reader.ReadBoolean();

            //IndexSize
            IndexSize = reader.ReadInt32();

            //Metadata
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                Metadata = reader.ReadBytes(len);
            }

            //ResultItemList
            int listCount = reader.ReadInt32();

            ResultItemList = new List <ResultItem>(listCount);
            if (listCount > 0)
            {
                ResultItem resultItem;
                for (int i = 0; i < listCount; i++)
                {
                    resultItem = new ResultItem();
                    resultItem.Deserialize(reader);
                    ResultItemList.Add(resultItem);
                }
            }

            //ExceptionInfo
            ExceptionInfo = reader.ReadString();

            //VirtualCount
            if (version >= 2)
            {
                VirtualCount = reader.ReadInt32();
            }

            //IndexCap
            if (version >= 3)
            {
                IndexCap = reader.ReadInt32();
            }

            if (version >= 4)
            {
                //MetadataPropertyCollection
                if (reader.ReadBoolean())
                {
                    MetadataPropertyCollection = new MetadataPropertyCollection();
                    Serializer.Deserialize(reader.BaseStream, MetadataPropertyCollection);
                }
            }
        }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexId
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                indexId = reader.ReadBytes(len);
            }

            //IndexItemList
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                IndexItem indexItem;
                indexItemList = new List <IndexItem>(count);
                for (ushort i = 0; i < count; i++)
                {
                    indexItem = new IndexItem();
                    indexItem.Deserialize(reader);
                    indexItemList.Add(indexItem);
                }
            }

            //TargetIndexName
            targetIndexName = reader.ReadString();

            //TagsFromIndexes
            count           = reader.ReadUInt16();
            tagsFromIndexes = new List <string>(count);
            if (count > 0)
            {
                for (ushort i = 0; i < count; i++)
                {
                    tagsFromIndexes.Add(reader.ReadString());
                }
            }

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetMetadata
            getMetadata = reader.ReadBoolean();

            if (version >= 2)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
        }
Example #4
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //IndexId
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    IndexId = reader.ReadBytes(len);
                }

                //Count
                Count = reader.ReadInt32();

                //TargetIndexName
                TargetIndexName = reader.ReadString();

                //ExcludeData
                ExcludeData = reader.ReadBoolean();

                //GetMetadata
                GetMetadata = reader.ReadBoolean();

                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    Filter = FilterFactory.CreateFilter(reader, filterType);
                }

                //FullDataIdInfo
                if (reader.ReadBoolean())
                {
                    FullDataIdInfo = new FullDataIdInfo();
                    Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
                }

                //IndexCondition
                if (reader.ReadBoolean())
                {
                    IndexCondition = new IndexCondition();
                    Serializer.Deserialize(reader.BaseStream, IndexCondition);
                }

                if (version >= 2)
                {
                    //DomainSpecificProcessingType
                    DomainSpecificProcessingType = (DomainSpecificProcessingType)reader.ReadByte();
                }
            }
        }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //MultiItemResult
            if (reader.ReadByte() != 0)
            {
                MultiItemResult = new MultiItemResult();
                MultiItemResult.Deserialize(reader);
            }

            //Metadata
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                Metadata = reader.ReadBytes(len);
            }

            //IndexSize
            IndexSize = reader.ReadInt32();

            //IndexExists
            IndexExists = reader.ReadBoolean();

            //ExceptionInfo
            ExceptionInfo = reader.ReadString();

            //VirtualCount
            if (version >= 2)
            {
                VirtualCount = reader.ReadInt32();
            }

            //IndexCap
            if (version >= 3)
            {
                IndexCap = reader.ReadInt32();
            }

            if (version >= 4)
            {
                //MetadataPropertyCollection
                if (reader.ReadBoolean())
                {
                    MetadataPropertyCollection = new MetadataPropertyCollection();
                    Serializer.Deserialize(reader.BaseStream, MetadataPropertyCollection);
                }
            }
        }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //MultiItemResult
            if (reader.ReadByte() != 0)
            {
                multiItemResult = new MultiItemResult();
                multiItemResult.Deserialize(reader);
            }

            //Metadata
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                metadata = reader.ReadBytes(len);
            }

            //IndexSize
            indexSize = reader.ReadInt32();

            //IndexExists
            indexExists = reader.ReadBoolean();

            //ExceptionInfo
            exceptionInfo = reader.ReadString();

            //VirtualCount
            if (version >= 2)
            {
                virtualCount = reader.ReadInt32();
            }
        }
Example #7
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    filter = FilterFactory.CreateFilter(reader, filterType);
                }

                if (version >= 2)
                {
                    //Count
                    Count = reader.ReadInt32();

                    //IndexCondition
                    if (reader.ReadBoolean())
                    {
                        IndexCondition = new IndexCondition();
                        Serializer.Deserialize(reader.BaseStream, IndexCondition);
                    }
                }
            }
        }
Example #8
0
 /// <summary>
 ///     <para>Deserialize the class data from a stream.</para>
 /// </summary>
 /// <param name="reader">
 ///     <para>The <see cref="IPrimitiveReader"/> that extracts used to extra data from a stream.</para>
 /// </param>
 /// <param name="version">
 ///     <para>The value of <see cref="CurrentVersion"/> that was written to the stream when it was originally serialized to a stream; the version of the <paramref name="reader"/> data.</para>
 /// </param>
 public void Deserialize(IPrimitiveReader reader, int version)
 {
     if (version == 1)
     {
         if (reader.ReadBoolean())
         {
             var keySpace          = DataBuffer.DeserializeValue(reader);
             var descr             = LocalCache.Policy.GetDescription(keySpace);
             var dependencyVersion = reader.ReadInt32();
             CustomDependency = (IObjectDependency)descr.Creator();
             CustomDependency.Deserialize(reader, dependencyVersion);
             Type            = new DependencyType();
             Reference       = null;
             LastUpdatedDate = new DateTime();
         }
         else
         {
             CustomDependency = null;
             Type             = (DependencyType)reader.ReadInt32();
             Reference        = reader.Read <ObjectReference>(false);
             LastUpdatedDate  = reader.ReadDateTime();
         }
     }
     else
     {
         reader.Response = SerializationResponse.Unhandled;
     }
 }
Example #9
0
        /// <summary>
        /// Deserialize the class data from a stream.
        /// </summary>
        /// <param name="reader">The <see cref="T:MySpace.Common.IO.IPrimitiveReader"/> that extracts used to extra data from a stream.</param>
        /// <param name="version">The value of <see cref="P:MySpace.Common.IVersionSerializable.CurrentVersion"/> that was written to the stream when it was originally serialized to a stream;
        /// the version of the <paramref name="reader"/> data.</param>
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //FieldValue
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    FieldValue = reader.ReadBytes(len);
                }
                else
                {
                    new LogWrapper().Error("FieldValue in FilterCaps cannot be null or zero length byte array");
                    throw new Exception("FieldValue in FilterCaps cannot be null or zero length byte array");
                }

                //UseParentFilter
                UseParentFilter = reader.ReadBoolean();

                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    Filter = FilterFactory.CreateFilter(reader, (FilterType)b);
                }

                //Cap
                Cap = reader.ReadInt32();
            }
        }
Example #10
0
        /// <summary>
        /// Deserialize the class data from a stream.
        /// </summary>
        /// <param name="reader">The <see cref="T:MySpace.Common.IO.IPrimitiveReader"/> that extracts used to extra data from a stream.</param>
        /// <param name="version">The value of <see cref="P:MySpace.Common.IVersionSerializable.CurrentVersion"/> that was written to the stream when it was originally serialized to a stream;
        /// the version of the <paramref name="reader"/> data.</param>
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //KeyBagMapping
                ushort count = reader.ReadUInt16();
                if (count > 0)
                {
                    ResultItemBag resultItemBag = null;
                    byte[]        compositeKey;
                    ushort        len;
                    KeyBagMapping = new Dictionary <byte[], ResultItemBag>(new ByteArrayEqualityComparer());
                    for (int i = 0; i < count; i++)
                    {
                        len = reader.ReadUInt16();
                        if (len > 0)
                        {
                            //CompositeKey
                            compositeKey = reader.ReadBytes(len);

                            //ResultItemBag
                            if (reader.ReadBoolean())
                            {
                                resultItemBag = new ResultItemBag(BaseComparer, compositeKey);
                                Serializer.Deserialize(reader.BaseStream, resultItemBag);
                            }
                            KeyBagMapping.Add(compositeKey, resultItemBag);
                            SortedResultItemBagList.Add(resultItemBag);
                        }
                    }
                }
            }
        }
        /// <summary>
        /// Deserialize the class data from a stream.
        /// </summary>
        /// <param name="reader">The <see cref="T:MySpace.Common.IO.IPrimitiveReader"/> that extracts used to extra data from a stream.</param>
        /// <param name="version">The value of <see cref="P:MySpace.Common.IVersionSerializable.CurrentVersion"/> that was written to the stream when it was originally serialized to a stream;
        /// the version of the <paramref name="reader"/> data.</param>
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //FullDataIdType
                FullDataIdType = (FullDataIdType)reader.ReadByte();

                //TagName
                TagName = reader.ReadString();

                if (version >= 2)
                {
                    //Offset
                    reader.ReadInt32();

                    //Count
                    reader.ReadInt32();

                    //DataType
                    DataType = (DataType)reader.ReadByte();

                    //FullDataIdFieldList
                    if (reader.ReadBoolean())
                    {
                        FullDataIdFieldList = new FullDataIdFieldList();
                        Serializer.Deserialize(reader.BaseStream, FullDataIdFieldList);
                    }

                    //FullDataIdPartFormat
                    FullDataIdPartFormat = (FullDataIdPartFormat)reader.ReadByte();
                }
            }
        }
Example #12
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexId
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                IndexId = reader.ReadBytes(len);
            }

            //FieldName
            FieldName = reader.ReadString();

            //ItemsToLookUp
            ItemsToLookUp = reader.ReadNullableInt32();

            //TargetIndexName
            TargetIndexName = reader.ReadString();

            //IndexCondition
            if (reader.ReadBoolean())
            {
                IndexCondition = new IndexCondition();
                Serializer.Deserialize(reader.BaseStream, IndexCondition);
            }
        }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexExists
            IndexExists = reader.ReadBoolean();

            //DistinctValueCountPairList
            int listCount = reader.ReadInt32();

            DistinctValueCountMapping = new Dictionary <byte[], int>(listCount, new ByteArrayEqualityComparer());
            if (listCount > 0)
            {
                for (int i = 0; i < listCount; i++)
                {
                    //Value
                    ushort len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        DistinctValueCountMapping.Add(reader.ReadBytes(len), reader.ReadInt32());
                    }
                }
            }

            //ExceptionInfo
            ExceptionInfo = reader.ReadString();
        }
Example #14
0
 public override void Deserialize(IPrimitiveReader reader)
 {
     IsEmpty = reader.ReadBoolean();
     //Id = reader.ReadInt32();
     AppId       = reader.ReadString();
     AccessToken = reader.ReadString();
     ExpireTime  = reader.ReadDateTime();
 }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexId
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                indexId = reader.ReadBytes(len);
            }

            //Offset
            offset = reader.ReadInt32();

            //ItemNum
            itemNum = reader.ReadInt32();

            //TargetIndexName
            targetIndexName = reader.ReadString();

            //Read a byte to account for deprecated CriterionList
            reader.ReadByte();

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetMetadata
            getMetadata = reader.ReadBoolean();

            if (version >= 2)
            {
                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    filter = FilterFactory.CreateFilter(reader, filterType);
                }
            }

            if (version >= 3)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
        }
 public override void Deserialize(IPrimitiveReader reader)
 {
     IsEmpty   = reader.ReadBoolean();
     Code      = reader.ReadString();
     TitaAppId = reader.ReadInt32();
     TenantId  = reader.ReadInt32();
     UserId    = reader.ReadInt32();
     State     = (QrCodeLoginState)reader.ReadInt16();
 }
Example #17
0
 public static IPEndPoint ReadIPEndPoint(this IPrimitiveReader reader)
 {
     if (reader.ReadBoolean())
     {
         var address = reader.ReadIPAddress();
         var port    = reader.ReadVarInt32();
         return(new IPEndPoint(address, port));
     }
     return(null);
 }
        /// <summary>
        /// Deserialize the class data from a stream.
        /// </summary>
        /// <param name="reader">The <see cref="T:MySpace.Common.IO.IPrimitiveReader"/> that extracts used to extra data from a stream.</param>
        /// <param name="version">The value of <see cref="P:MySpace.Common.IVersionSerializable.CurrentVersion"/> that was written to the stream when it was originally serialized to a stream;
        /// the version of the <paramref name="reader"/> data.</param>
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //MetadataPropertyCollection
            if (reader.ReadBoolean())
            {
                MetadataPropertyCollection = new MetadataPropertyCollection();
                Serializer.Deserialize(reader.BaseStream, MetadataPropertyCollection);
            }

            //ExceptionInfo
            ExceptionInfo = reader.ReadString();
        }
Example #19
0
        public void Deserialize(IPrimitiveReader reader)
        {
            //TagName
            tagName = reader.ReadString();

            //IsTag
            isTag = reader.ReadBoolean();

            //SortOrder
            sortOrder = new SortOrder();
            sortOrder.Deserialize(reader);
        }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //IndexId
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    indexId = reader.ReadBytes(len);
                }

                //Count
                count = reader.ReadInt32();

                //TargetIndexName
                targetIndexName = reader.ReadString();

                //ExcludeData
                excludeData = reader.ReadBoolean();

                //GetMetadata
                getMetadata = reader.ReadBoolean();

                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    filter = FilterFactory.CreateFilter(reader, filterType);
                }

                if (version >= 2)
                {
                    //FullDataIdInfo
                    fullDataIdInfo = new FullDataIdInfo();
                    Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
                }
            }
        }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //MultiIndexContainsQueryResultItemIndexHeaderList
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                MultiIndexContainsQueryResultItemIndexHeaderList = new List <Pair <MultiIndexContainsQueryResultItem, IndexHeader> >(count);
                MultiIndexContainsQueryResultItem multiIndexContainsQueryResultItem;
                IndexHeader indexHeader;

                for (ushort i = 0; i < count; i++)
                {
                    multiIndexContainsQueryResultItem = null;
                    indexHeader = null;

                    //MultiIndexContainsQueryResultItem
                    if (reader.ReadBoolean())
                    {
                        multiIndexContainsQueryResultItem = new MultiIndexContainsQueryResultItem();
                        Serializer.Deserialize(reader.BaseStream, multiIndexContainsQueryResultItem);
                    }

                    //IndexHeader
                    if (reader.ReadBoolean())
                    {
                        indexHeader = new IndexHeader();
                        Serializer.Deserialize(reader.BaseStream, indexHeader);
                    }

                    MultiIndexContainsQueryResultItemIndexHeaderList.Add(new Pair <MultiIndexContainsQueryResultItem, IndexHeader>(multiIndexContainsQueryResultItem, indexHeader));
                }
            }

            //ExceptionInfo
            ExceptionInfo = reader.ReadString();
        }
Example #22
0
        /// <summary>
        /// Deserialize the class data from a stream.
        /// </summary>
        /// <param name="reader">The <see cref="T:MySpace.Common.IO.IPrimitiveReader"/> that extracts used to extra data from a stream.</param>
        /// <param name="version">The value of <see cref="P:MySpace.Common.IVersionSerializable.CurrentVersion"/> that was written to the stream when it was originally serialized to a stream;
        /// the version of the <paramref name="reader"/> data.</param>
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //FieldName
                FieldName = reader.ReadString();

                //FilterCaps
                FilterCaps = new FilterCaps();
                Serializer.Deserialize(reader.BaseStream, FilterCaps);

                if (version >= 2)
                {
                    //IgnoreNonCappedItems
                    IgnoreNonCappedItems = reader.ReadBoolean();
                }
            }
        }
Example #23
0
        /// <summary>
        /// Deserializes the specified reader.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="version">The version.</param>
        public override void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //FieldName
                FieldName = reader.ReadString();

                //IsTag
                IsTag = reader.ReadBoolean();

                //Operation
                Operation = (Operation)reader.ReadByte();

                //Value
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    Value = reader.ReadBytes(len);
                }

                //DataType
                DataType = (DataType)reader.ReadByte();

                if (version >= 2)
                {
                    //MatchValue
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        ExpectedBitwiseResult = reader.ReadBytes(len);
                    }

                    //ShiftBy
                    ShiftBy = reader.ReadByte();
                }

                if (version >= 3)
                {
                    //MetadataProperty
                    MetadataProperty = reader.ReadString();
                }
            }
        }
Example #24
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //TypeExists
            TypeExists = reader.ReadBoolean();

            //TagNameList
            byte tagNamesLength = reader.ReadByte();

            if (tagNamesLength > 0)
            {
                TagNames = new string[tagNamesLength];
                for (int i = 0; i < tagNamesLength; i++)
                {
                    TagNames[i] = reader.ReadString();
                }
            }

            //ExceptionInfo
            ExceptionInfo = reader.ReadString();
        }
Example #25
0
        /// <summary>
        /// Deserializes a <see cref="RelayPayload"/> from an <see cref="IPrimitiveReader"/>.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="version">The version of the <paramref name="reader"/> data.</param>
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            this.TypeId           = reader.ReadInt16();
            this.Id               = reader.ReadInt32();
            this.LastUpdatedTicks = reader.ReadInt64();
            this.Compressed       = reader.ReadBoolean();
            this.ttl              = reader.ReadInt32();
            this.expirationTicks  = reader.ReadInt64();
            int byteLength = reader.ReadInt32();

            if (byteLength > 0)
            {
                this.ByteArray = reader.ReadBytes(byteLength);
            }
            if (version > 1)
            {
                int keyLength = reader.ReadInt32();
                this.ExtendedId = reader.ReadBytes(keyLength);
            }
        }
Example #26
0
        /// <summary>
        /// Deserializes the specified reader.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="version">The version.</param>
        public override void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //IndexId
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    IndexId = reader.ReadBytes(len);
                }

                //TargetIndexName
                TargetIndexName = reader.ReadString();

                //MetadataPropertyCollectionUpdate
                if (reader.ReadBoolean())
                {
                    MetadataPropertyCollectionUpdate = new MetadataPropertyCollectionUpdate();
                    Serializer.Deserialize(reader.BaseStream, MetadataPropertyCollectionUpdate);
                }
            }
        }
Example #27
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //Metadata
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                Metadata = reader.ReadBytes(len);
            }

            //VirtualCount
            VirtualCount = reader.ReadInt32();

            if (version >= 2)
            {
                //MetadataPropertyCollection
                if (reader.ReadBoolean())
                {
                    MetadataPropertyCollection = new MetadataPropertyCollection();
                    Serializer.Deserialize(reader.BaseStream, MetadataPropertyCollection);
                }
            }
        }
Example #28
0
        public virtual void Deserialize(IPrimitiveReader reader, int version)
        {
            //TargetIndexName
            targetIndexName = reader.ReadString();

            //IndexIdList
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                indexIdList = new List <byte[]>(count);
                ushort len;
                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        indexIdList.Add(reader.ReadBytes(len));
                    }
                }
            }

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetIndexHeader
            getIndexHeader = reader.ReadBoolean();

            //PrimaryIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                primaryIdList = new List <int>(count);
                for (ushort i = 0; i < count; i++)
                {
                    primaryIdList.Add(reader.ReadInt32());
                }
            }

            //Filter
            byte b = reader.ReadByte();

            if (b != 0)
            {
                FilterType filterType = (FilterType)b;
                filter = FilterFactory.CreateFilter(reader, filterType);
            }

            //IndexIdParamsMapping
            count = reader.ReadUInt16();
            if (count > 0)
            {
                intersectionQueryParamsMapping = new Dictionary <byte[], IntersectionQueryParams>(count, new ByteArrayEqualityComparer());
                byte[] indexId;
                IntersectionQueryParams intersectionQueryParam;
                ushort len;

                for (ushort i = 0; i < count; i++)
                {
                    len     = reader.ReadUInt16();
                    indexId = null;
                    if (len > 0)
                    {
                        indexId = reader.ReadBytes(len);

                        intersectionQueryParam = new IntersectionQueryParams();
                        Serializer.Deserialize(reader.BaseStream, intersectionQueryParam);

                        intersectionQueryParamsMapping.Add(indexId, intersectionQueryParam);
                    }
                }
            }

            if (version >= 2)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
        }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexId
            ushort len = reader.ReadUInt16();
            if (len > 0)
            {
                indexId = reader.ReadBytes(len);
            }

            //FirstPageSize
            firstPageSize = reader.ReadInt32();

            //LastPageSize
            lastPageSize = reader.ReadInt32();

            //TargetIndexName
            targetIndexName = reader.ReadString();

            //Read a byte to account for deprecated CriterionList
            reader.ReadByte();

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetMetadata
            getMetadata = reader.ReadBoolean();

            if (version >= 2)
            {
                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    filter = FilterFactory.CreateFilter(reader, filterType);
                }
            }

            if(version >= 3)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
        }
Example #30
0
		public void Deserialize(IPrimitiveReader reader)
		{
			//TagName
			tagName = reader.ReadString();

			//IsTag
			isTag = reader.ReadBoolean();

			//SortOrder
			sortOrder = new SortOrder();
			sortOrder.Deserialize(reader);
		}
Example #31
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //IndexId
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    indexId = reader.ReadBytes(len);
                }

                //Count
                count = reader.ReadInt32();

                //TargetIndexName
                targetIndexName = reader.ReadString();

                //ExcludeData
                excludeData = reader.ReadBoolean();

                //GetMetadata
                getMetadata = reader.ReadBoolean();

                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType) b;
                    filter = FilterFactory.CreateFilter(reader, filterType);
                }

                if (version >= 2)
                {
                    //FullDataIdInfo
                    fullDataIdInfo = new FullDataIdInfo();
                    Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
                }
            }
        }
Example #32
0
        /// <summary>
        /// Deserializes the specified reader.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="version">The version.</param>
        public override void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //FieldName
                FieldName = reader.ReadString();

                //IsTag
                IsTag = reader.ReadBoolean();

                //Operation
                Operation = (Operation)reader.ReadByte();

                //Value
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    Value = reader.ReadBytes(len);
                }

                //DataType
                DataType = (DataType)reader.ReadByte();

                if (version >= 2)
                {
                    //MatchValue
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        ExpectedBitwiseResult = reader.ReadBytes(len);
                    }

                    //ShiftBy
                    ShiftBy = reader.ReadByte();
                }
            }
        }
		public void Deserialize(IPrimitiveReader reader, int version)
		{
            //MultiItemResult
            if (reader.ReadByte() != 0)
            {
                multiItemResult = new MultiItemResult();
                multiItemResult.Deserialize(reader);
            }

            //Metadata
            ushort len = reader.ReadUInt16();
            if (len > 0)
            {
                metadata = reader.ReadBytes(len);
            }

            //IndexSize
            indexSize = reader.ReadInt32();

            //IndexExists
            indexExists = reader.ReadBoolean();

            //ExceptionInfo
            exceptionInfo = reader.ReadString();

            //VirtualCount
            if(version >= 2)
            {
                virtualCount = reader.ReadInt32();
            }
        }
        public override void Deserialize(IPrimitiveReader reader, int version)
        {
            //ResultItemList
            int listCount = reader.ReadInt32();
            ResultItemList = new List<ResultItem>(listCount);
            if (listCount > 0)
            {
                ResultItem resultItem;
                for (int i = 0; i < listCount; i++)
                {
                    resultItem = new ResultItem();
                    resultItem.Deserialize(reader);
                    ResultItemList.Add(resultItem);
                }
            }

            //IndexIdIndexHeaderMapping
            ushort count = reader.ReadUInt16();
            if (count > 0)
            {
                IndexIdIndexHeaderMapping = new Dictionary<byte[], IndexHeader>(count, new ByteArrayEqualityComparer());
                byte[] indexId;
                IndexHeader indexHeader;
                ushort len;

                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    indexId = null;
                    if (len > 0)
                    {
                        indexId = reader.ReadBytes(len);
                    }
                    indexHeader = new IndexHeader();
                    Serializer.Deserialize(reader.BaseStream, indexHeader);

                    IndexIdIndexHeaderMapping.Add(indexId, indexHeader);
                }
            }

            //TotalCount
            TotalCount = reader.ReadInt32();

            //IsTagPrimarySort
            IsTagPrimarySort = reader.ReadBoolean();

            //SortFieldName
            SortFieldName = reader.ReadString();

            //SortOrderList
            count = reader.ReadUInt16();
            SortOrderList = new List<SortOrder>(count);
            SortOrder sortOrder;
            for (int i = 0; i < count; i++)
            {
                sortOrder = new SortOrder();
                sortOrder.Deserialize(reader);
                SortOrderList.Add(sortOrder);
            }

            //ExceptionInfo
            ExceptionInfo = reader.ReadString();

            //AdditionalAvailableItemCount
            AdditionalAvailableItemCount = reader.ReadInt32();
        }
		public void Deserialize(IPrimitiveReader reader, int version)
		{
            //IndexId
            ushort len = reader.ReadUInt16();
            if (len > 0)
            {
                indexId = reader.ReadBytes(len);
            }

            //IndexItemList
            ushort count = reader.ReadUInt16();
            if (count > 0)
            {
                IndexItem indexItem;
                indexItemList = new List<IndexItem>(count);
                for (ushort i = 0; i < count; i++)
                {
                    indexItem = new IndexItem();
                    indexItem.Deserialize(reader);
                    indexItemList.Add(indexItem);
                }
            }

            //TargetIndexName
            targetIndexName = reader.ReadString();

            //TagsFromIndexes
            count = reader.ReadUInt16();
            tagsFromIndexes = new List<string>(count);
            if (count > 0)
            {
                for (ushort i = 0; i < count; i++)
                {
                    tagsFromIndexes.Add(reader.ReadString());
                }
            }

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetMetadata
            getMetadata = reader.ReadBoolean();

            if(version >= 2)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
		}
        /// <summary>
        /// Deserialize the class data from a stream.
        /// </summary>
        /// <param name="reader">The <see cref="T:MySpace.Common.IO.IPrimitiveReader"/> that extracts used to extra data from a stream.</param>
        /// <param name="version">The value of <see cref="P:MySpace.Common.IVersionSerializable.CurrentVersion"/> that was written to the stream when it was originally serialized to a stream;
        /// the version of the <paramref name="reader"/> data.</param>
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //FullDataIdType
                FullDataIdType = (FullDataIdType)reader.ReadByte();

                //TagName
                TagName = reader.ReadString();

                if (version >= 2)
                {
                    //Offset
                    reader.ReadInt32();

                    //Count
                    reader.ReadInt32();

                    //DataType
                    DataType = (DataType)reader.ReadByte();

                    //FullDataIdFieldList
                    if (reader.ReadBoolean())
                    {
                        FullDataIdFieldList = new FullDataIdFieldList();
                        Serializer.Deserialize(reader.BaseStream, FullDataIdFieldList);
                    }

                    //FullDataIdPartFormat
                    FullDataIdPartFormat = (FullDataIdPartFormat)reader.ReadByte();
                }
            }
        }
Example #37
0
		public void Deserialize(IPrimitiveReader reader, int version)
		{
			//IndexId
			ushort len = reader.ReadUInt16();
			if (len > 0)
			{
				indexId = reader.ReadBytes(len);
			}

			//TargetIndexName
			targetIndexName = reader.ReadString();

			//IndexTagMapping
			ushort count = reader.ReadUInt16();
			indexTagMapping = new Dictionary<string, List<string>>(count);
			if (count > 0)
			{
				string indexName;
				ushort tagNameListCount;
				List<string> tagNameList;

				for (ushort i = 0; i < count; i++)
				{
					indexName = reader.ReadString();
					tagNameListCount = reader.ReadUInt16();
					tagNameList = new List<string>();
					for (ushort j = 0; j < tagNameListCount; j++)
					{
						tagNameList.Add(reader.ReadString());
					}
					indexTagMapping.Add(indexName, tagNameList);
				}
			}

			//AddList
			int listCount = reader.ReadInt32();
			addList = new List<IndexDataItem>(listCount);
			IndexDataItem indexDataItem;
			for (int i = 0; i < listCount; i++)
			{
				indexDataItem = new IndexDataItem();
				indexDataItem.Deserialize(reader);
				addList.Add(indexDataItem);
			}

			//DeleteList
			listCount = reader.ReadInt32();
			deleteList = new List<IndexItem>(listCount);
			IndexItem indexItem;
			for (int i = 0; i < listCount; i++)
			{
				indexItem = new IndexItem();
				indexItem.Deserialize(reader);
				deleteList.Add(indexItem);
			}

			//Metadata
			len = reader.ReadUInt16();
			if (len > 0)
			{
				metadata = reader.ReadBytes(len);
			}

			//UpdateMetadata
			updateMetadata = reader.ReadBoolean();

			//ReplaceFullIndex
			replaceFullIndex = reader.ReadBoolean();

            if (version >= 2)
            {
                //PreserveData
                preserveData = reader.ReadBoolean();
            }

            if(version >= 3)
            {
                //IndexVirtualCountMapping
                count = reader.ReadUInt16();
                if (count > 0)
                {
                    indexVirtualCountMapping = new Dictionary<string, int>(count);
                    string indexName;
                    int virtualCount;

                    for (ushort i = 0; i < count; i++)
                    {
                        indexName = reader.ReadString();
                        virtualCount = reader.ReadInt32();
                        indexVirtualCountMapping.Add(indexName, virtualCount);
                    }
                }
            }

            if (version >= 4)
            {
                //PrimaryId
                primaryId = reader.ReadInt32();
            }
		}
Example #38
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexId
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                IndexId = reader.ReadBytes(len);
            }

            //TargetIndexName
            TargetIndexName = reader.ReadString();

            //IndexTagMapping
            ushort count = reader.ReadUInt16();

            IndexTagMapping = new Dictionary <string, List <string> >(count);
            if (count > 0)
            {
                string        indexName;
                ushort        tagNameListCount;
                List <string> tagNameList;

                for (ushort i = 0; i < count; i++)
                {
                    indexName        = reader.ReadString();
                    tagNameListCount = reader.ReadUInt16();
                    tagNameList      = new List <string>();
                    for (ushort j = 0; j < tagNameListCount; j++)
                    {
                        tagNameList.Add(reader.ReadString());
                    }
                    IndexTagMapping.Add(indexName, tagNameList);
                }
            }

            //AddList
            AddList = DeserializeIndexDataItemList(reader);

            //DeleteList
            int listCount = reader.ReadInt32();

            DeleteList = new List <IndexItem>(listCount);
            IndexItem indexItem;

            for (int i = 0; i < listCount; i++)
            {
                indexItem = new IndexItem();
                indexItem.Deserialize(reader);
                DeleteList.Add(indexItem);
            }

            //Metadata
            len = reader.ReadUInt16();
            if (len > 0)
            {
                Metadata = reader.ReadBytes(len);
            }

            //UpdateMetadata
            UpdateMetadata = reader.ReadBoolean();

            //ReplaceFullIndex
            ReplaceFullIndex = reader.ReadBoolean();

            if (version >= 2)
            {
                //PreserveData
                PreserveData = reader.ReadBoolean();
            }

            if (version >= 3)
            {
                //IndexVirtualCountMapping
                count = reader.ReadUInt16();
                if (count > 0)
                {
                    IndexVirtualCountMapping = new Dictionary <string, int>(count);
                    string indexName;
                    int    virtualCount;

                    for (ushort i = 0; i < count; i++)
                    {
                        indexName    = reader.ReadString();
                        virtualCount = reader.ReadInt32();
                        IndexVirtualCountMapping.Add(indexName, virtualCount);
                    }
                }
            }

            if (version >= 4)
            {
                //PrimaryId
                primaryId = reader.ReadInt32();
            }

            if (version >= 5)
            {
                //MetadataPropertyCollectionUpdate
                if (reader.ReadBoolean())
                {
                    MetadataPropertyCollectionUpdate = new MetadataPropertyCollectionUpdate();
                    Serializer.Deserialize(reader.BaseStream, MetadataPropertyCollectionUpdate);
                }
            }

            if (version >= 6)
            {
                //UpdateList
                UpdateList = DeserializeIndexDataItemList(reader);
            }
        }
        public override void Deserialize(IPrimitiveReader reader, int version)
        {
            //Offset
            Offset = reader.ReadInt32();

            //Span
            Span = reader.ReadInt32();

            //TargetIndexName
            TargetIndexName = reader.ReadString();

            //TagsFromIndexes
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                TagsFromIndexes = new List <string>(count);
                for (ushort i = 0; i < count; i++)
                {
                    TagsFromIndexes.Add(reader.ReadString());
                }
            }

            //TagSort
            if (reader.ReadByte() != 0)
            {
                TagSort = new TagSort();
                Serializer.Deserialize(reader.BaseStream, TagSort);
            }

            //IndexIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                IndexIdList = new List <byte[]>(count);
                ushort len;
                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        IndexIdList.Add(reader.ReadBytes(len));
                    }
                }
            }

            //Read a byte to account for deprecated CriterionList
            reader.ReadByte();

            //MaxItemsPerIndex
            MaxItems = reader.ReadInt32();

            //ExcludeData
            ExcludeData = reader.ReadBoolean();

            //GetIndexHeader
            GetIndexHeader = reader.ReadBoolean();

            //GetPageableItemCount
            GetAdditionalAvailableItemCount = reader.ReadBoolean();

            //PrimaryIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                PrimaryIdList = new List <int>(count);
                for (ushort i = 0; i < count; i++)
                {
                    PrimaryIdList.Add(reader.ReadInt32());
                }
            }

            //Filter
            byte b = reader.ReadByte();

            if (b != 0)
            {
                FilterType filterType = (FilterType)b;
                Filter = FilterFactory.CreateFilter(reader, filterType);
            }

            //IndexIdParamsMapping
            count = reader.ReadUInt16();
            if (count > 0)
            {
                IndexIdParamsMapping = new Dictionary <byte[], IndexIdParams>(count, new ByteArrayEqualityComparer());
                byte[]        indexId;
                IndexIdParams indexIdParam;
                ushort        len;

                for (ushort i = 0; i < count; i++)
                {
                    len     = reader.ReadUInt16();
                    indexId = null;
                    if (len > 0)
                    {
                        indexId = reader.ReadBytes(len);

                        indexIdParam = new IndexIdParams();
                        Serializer.Deserialize(reader.BaseStream, indexIdParam);

                        IndexIdParamsMapping.Add(indexId, indexIdParam);
                    }
                }
            }

            //FullDataIdInfo
            if (reader.ReadBoolean())
            {
                FullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
            }

            //ClientSideSubsetProcessingRequired
            ClientSideSubsetProcessingRequired = reader.ReadBoolean();

            if (version >= 2)
            {
                //CapCondition
                if (reader.ReadBoolean())
                {
                    CapCondition = new CapCondition();
                    Serializer.Deserialize(reader.BaseStream, CapCondition);
                }
            }

            if (version >= 3)
            {
                //GetIndexHeaderType
                GetIndexHeaderType = (GetIndexHeaderType)reader.ReadByte();
            }
        }
        public virtual void Deserialize(IPrimitiveReader reader, int version)
        {
            //TargetIndexName
            targetIndexName = reader.ReadString();

            //IndexIdList
            ushort count = reader.ReadUInt16();
            if (count > 0)
            {
                indexIdList = new List<byte[]>(count);
                ushort len;
                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        indexIdList.Add(reader.ReadBytes(len));
                    }
                }
            }

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetIndexHeader
            getIndexHeader = reader.ReadBoolean();

            //PrimaryIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                primaryIdList = new List<int>(count);
                for (ushort i = 0; i < count; i++)
                {
                    primaryIdList.Add(reader.ReadInt32());
                }
            }

            //Filter
            byte b = reader.ReadByte();
            if (b != 0)
            {
                FilterType filterType = (FilterType)b;
                filter = FilterFactory.CreateFilter(reader, filterType);
            }

            //IndexIdParamsMapping
            count = reader.ReadUInt16();
            if (count > 0)
            {
                intersectionQueryParamsMapping = new Dictionary<byte[], IntersectionQueryParams>(count, new ByteArrayEqualityComparer());
                byte[] indexId;
                IntersectionQueryParams intersectionQueryParam;
                ushort len;

                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    indexId = null;
                    if (len > 0)
                    {
                        indexId = reader.ReadBytes(len);

                        intersectionQueryParam = new IntersectionQueryParams();
                        Serializer.Deserialize(reader.BaseStream, intersectionQueryParam);

                        intersectionQueryParamsMapping.Add(indexId, intersectionQueryParam);
                    }
                }
            }

            if (version >= 2)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
        }