Ejemplo n.º 1
0
                public IncermentalSearchContext(int count, Direction direction, ulong? referenceId)
                {
                    Result = new List<LogEntry>();

                    if (!referenceId.HasValue)
                    {
                        MaximalCount = 0;
                        return;
                    }

                    MaximalCount = count;
                    this.direction = direction;
                    currentStep = (ulong)count;

                    Range = new Range();

                    if (direction == Direction.Backward)
                    {
                        Range.MinimalId = SubstractToZero(referenceId.Value, currentStep);
                        Range.MaximalId = referenceId;
                    }
                    else
                    {
                        Range.MinimalId = referenceId;
                        Range.MaximalId = AddToMaxUlong(referenceId.Value, currentStep);
                    }
                }
Ejemplo n.º 2
0
            private static string CombineQuery(string queryString, ViewFilter view, Range forcedRange)
            {
                var values = new List<string>();

                var viewQueryString = view.GenerateQueryString();
                if(!string.IsNullOrEmpty(viewQueryString))
                {
                    values.Add(viewQueryString);
                }

                if(!string.IsNullOrEmpty(queryString))
                {
                    values.Add(queryString);
                }

                if(forcedRange != null)
                {
                    values.Add(forcedRange.GenerateQueryString());
                }

                return string.Join(" AND ", values.Select(x => string.Format("({0})", x)));
            }