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); } } }
/// <summary> /// Processes the metadata property condition. /// </summary> /// <param name="condition">The condition.</param> /// <param name="metadataPropertyCollection">The metadata property collection.</param> internal static void ProcessMetadataPropertyCondition(Condition condition, MetadataPropertyCollection metadataPropertyCollection) { if (!string.IsNullOrEmpty(condition.MetadataProperty) && metadataPropertyCollection != null) { byte[] metadataProperty; metadataPropertyCollection.TryGetValue(condition.MetadataProperty, out metadataProperty); condition.Value = metadataProperty; } }
public RandomQueryResult(bool indexExists, int indexSize, byte[] metadata, MetadataPropertyCollection metadataPropertyCollection, List <ResultItem> resultItemList, int virtualCount, int indexCap, string exceptionInfo) { Init(indexExists, indexSize, metadata, metadataPropertyCollection, resultItemList, virtualCount, indexCap, exceptionInfo); }
public ContainsIndexQueryResult(MultiItemResult multiItemResult, byte[] metadata, MetadataPropertyCollection metadataPropertyCollection, int indexSize, bool indexExists, int virtualCount, int indexCap, string exceptionInfo) { Init(multiItemResult, metadata, metadataPropertyCollection, indexSize, indexExists, virtualCount, indexCap, exceptionInfo); }
/// <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(); }
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); } } }
private void Init(bool indexExists, int indexSize, byte[] metadata, MetadataPropertyCollection metadataPropertyCollection, List <ResultItem> resultItemList, int virtualCount, int indexCap, string exceptionInfo) { IndexExists = indexExists; IndexSize = indexSize; Metadata = metadata; MetadataPropertyCollection = metadataPropertyCollection; ResultItemList = resultItemList; VirtualCount = virtualCount; IndexCap = indexCap; ExceptionInfo = exceptionInfo; }
private void Init(MultiItemResult multiItemResult, byte[] metadata, MetadataPropertyCollection metadataPropertyCollection, int indexSize, bool indexExists, int virtualCount, int indexCap, string exceptionInfo) { MultiItemResult = multiItemResult; Metadata = metadata; MetadataPropertyCollection = metadataPropertyCollection; IndexSize = indexSize; IndexExists = indexExists; VirtualCount = virtualCount; ExceptionInfo = exceptionInfo; IndexCap = indexCap; }
public FirstLastQueryResult(bool indexExists, int indexSize, byte[] metadata, MetadataPropertyCollection metadataPropertyCollection, List <ResultItem> firstPageResultItemList, List <ResultItem> lastPageResultItemList, int virtualCount, int indexCap, string exceptionInfo) { Init(indexExists, indexSize, metadata, metadataPropertyCollection, firstPageResultItemList, lastPageResultItemList, virtualCount, indexCap, exceptionInfo); }
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); } } }