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);
            }
        }
예제 #2
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 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);
            }
		}
예제 #4
0
        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);
            }

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

                //DomainSpecificProcessingType
                DomainSpecificProcessingType = (DomainSpecificProcessingType)reader.ReadByte();
            }
        }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //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));
                    }
                }
            }

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

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

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

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

                        multiIndexContainsQueryParams = null;
                        if (reader.ReadBoolean())
                        {
                            multiIndexContainsQueryParams = new MultiIndexContainsQueryParams();
                            Serializer.Deserialize(reader.BaseStream, multiIndexContainsQueryParams);
                        }

                        MultiIndexContainsQueryParamsMapping.Add(indexId, multiIndexContainsQueryParams);
                    }
                }
            }

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

            //Count
            Count = reader.ReadInt32();

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

            if (version >= 2)
            {
                //DomainSpecificProcessingType
                DomainSpecificProcessingType = (DomainSpecificProcessingType)reader.ReadByte();
            }
        }
예제 #6
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();
            }
		}