internal void CreateConditions(string fieldName, 
            bool isTag,
            SortOrder indexSortOrder, 
            out Condition enterCondition, 
            out Condition exitCondition)
        {
            // Enter and Exit Conditions are set for DESC sort order which is the common in most use cases
            enterCondition = InclusiveMaxValue != null ?
                new Condition(fieldName, isTag, Operation.LessThanEquals, InclusiveMaxValue, indexSortOrder.DataType) :
                null;

            exitCondition = InclusiveMinValue != null ?
                new Condition(fieldName, isTag, Operation.GreaterThanEquals, InclusiveMinValue, indexSortOrder.DataType) :
                null;

            if (indexSortOrder.SortBy == SortBy.ASC)
            {                
                var temp = enterCondition;
                enterCondition = exitCondition;
                exitCondition = temp;
            }
        }
        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 TagSort(string tagName, bool isTag, SortOrder sortOrder)
		{
			Init(tagName, isTag, sortOrder);
		}
Esempio n. 4
0
		private void Init(string tagName, bool isTag, SortOrder sortOrder)
		{
			this.tagName = tagName;
			this.isTag = isTag;
			this.sortOrder = sortOrder;
		}
Esempio n. 5
0
		public TagSort(string tagName, SortOrder sortOrder)
		{
			Init(tagName, true, sortOrder);
		}
Esempio n. 6
0
		public void Deserialize(IPrimitiveReader reader)
		{
			//TagName
			tagName = reader.ReadString();

			//IsTag
			isTag = reader.ReadBoolean();

			//SortOrder
			sortOrder = new SortOrder();
			sortOrder.Deserialize(reader);
		}
Esempio n. 7
0
 private void Init(string tagName, bool isTag, SortOrder sortOrder)
 {
     this.TagName   = tagName;
     this.IsTag     = isTag;
     this.SortOrder = sortOrder;
 }
Esempio n. 8
0
 public TagSort(string tagName, bool isTag, SortOrder sortOrder)
 {
     Init(tagName, isTag, sortOrder);
 }
Esempio n. 9
0
 public TagSort(string tagName, SortOrder sortOrder)
 {
     Init(tagName, true, sortOrder);
 }