Esempio n. 1
0
        public void Deserialize(IPrimitiveReader reader)
        {
            //TagName
            tagName = reader.ReadString();

            //IsTag
            isTag = reader.ReadBoolean();

            //SortOrder
            sortOrder = new SortOrder();
            sortOrder.Deserialize(reader);
        }
        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();
        }
Esempio n. 3
0
        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();
            ushort len;

            if (count > 0)
            {
                IndexIdIndexHeaderMapping = new Dictionary <byte[], IndexHeader>(count, new ByteArrayEqualityComparer());
                byte[]      indexId;
                IndexHeader indexHeader;

                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();

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

            if (version >= 3)
            {
                if (reader.ReadBoolean())
                {
                    GroupByResult = new GroupByResult(new BaseComparer(IsTagPrimarySort, SortFieldName, SortOrderList));
                    Serializer.Deserialize(reader.BaseStream, GroupByResult);
                }
            }
        }
Esempio n. 4
0
        public override void Deserialize(IPrimitiveReader reader, int version)
        {
            // set the object's current version to the server's object version
            if (version < CORRECT_SERVERSIDE_PAGING_LOGIC_VERSION)
            {
                this.currentVersion = 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();

            if (version >= 2)
            {
                //PageableItemCount
                AdditionalAvailableItemCount = reader.ReadInt32();
            }
        }
Esempio n. 5
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //ResultItemList
            int listCount = reader.ReadInt32();

            if (listCount > 0)
            {
                ResultItemList = new List <IndexDataItem>(listCount);
                IndexDataItem resultItem;
                for (int i = 0; i < listCount; i++)
                {
                    resultItem = new IndexDataItem();
                    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);
                }
            }

            //LocalIdentityTagNames
            listCount = reader.ReadInt32();
            if (listCount > 0)
            {
                LocalIdentityTagNames = new List <string>(listCount);
                for (int i = 0; i < listCount; i++)
                {
                    LocalIdentityTagNames.Add(reader.ReadString());
                }
            }

            //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();
        }
Esempio n. 6
0
		public void Deserialize(IPrimitiveReader reader)
		{
			//TagName
			tagName = reader.ReadString();

			//IsTag
			isTag = reader.ReadBoolean();

			//SortOrder
			sortOrder = new SortOrder();
			sortOrder.Deserialize(reader);
		}