/// <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(); } }
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); } } } }
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) { using (reader.CreateRegion()) { //Filter byte b = reader.ReadByte(); if (b != 0) { FilterType filterType = (FilterType)b; filter = FilterFactory.CreateFilter(reader, filterType); } } }
public override void Deserialize(IPrimitiveReader reader, int version) { using (reader.CreateRegion()) { FilterType filterType; ushort count = reader.ReadUInt16(); FilterList = new List <Filter>(count); Filter childFilter; for (ushort i = 0; i < count; i++) { filterType = (FilterType)reader.ReadByte(); childFilter = FilterFactory.CreateFilter(reader, filterType); FilterList.Add(childFilter); totalCount += childFilter.FilterCount; } } }
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 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 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(); //DeleteFilter byte b = reader.ReadByte(); if (b != 0) { FilterType filterType = (FilterType)b; DeleteFilter = FilterFactory.CreateFilter(reader, filterType); } } }
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); } }
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); } if (version >= 4) { //FullDataIdInfo if (reader.ReadBoolean()) { FullDataIdInfo = new FullDataIdInfo(); Serializer.Deserialize(reader.BaseStream, FullDataIdInfo); } //TagSort if (reader.ReadBoolean()) { TagSort = new TagSort(); Serializer.Deserialize(reader.BaseStream, TagSort); } } if (version >= 5) { //IndexCondition if (reader.ReadBoolean()) { IndexCondition = new IndexCondition(); Serializer.Deserialize(reader.BaseStream, IndexCondition); } } if (version >= 6) { //DomainSpecificProcessingType DomainSpecificProcessingType = (DomainSpecificProcessingType)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); } if (version >= 3) { //FullDataIdInfo if (reader.ReadBoolean()) { FullDataIdInfo = new FullDataIdInfo(); Serializer.Deserialize(reader.BaseStream, FullDataIdInfo); } //Count Count = reader.ReadInt32(); //MaxResultItems MaxResultItems = reader.ReadInt32(); //CanApplyMaxResultItemsOnServer IsSingleClusterQuery = reader.ReadBoolean(); //IndexCondition if (reader.ReadBoolean()) { IndexCondition = new IndexCondition(); Serializer.Deserialize(reader.BaseStream, IndexCondition); } } if (version >= 4) { //DomainSpecificProcessingType DomainSpecificProcessingType = (DomainSpecificProcessingType)reader.ReadByte(); } }