Esempio n. 1
0
        public CompulsoryQuerySegment(IQuerySegment segment)
        {
            if (segment == null)
            {
                throw new ArgumentNullException("segment");
            }

            Segment = segment;
        }
        public ExcludingQuerySegment(IQuerySegment segment)
        {
            if (segment == null)
            {
                throw new ArgumentNullException("segment");
            }

            Segment = segment;
        }
        public static void RenderBoolean(this IQuerySegment segment, StringBuilder target)
        {
            var bRend = segment as IBooleanSegment;

            if (bRend != null)
            {
                bRend.RenderAsBoolean(target);
                return;
            }

            segment.Render(target);
        }
Esempio n. 4
0
        public static IQuerySegment TryGet(ExpressionType type, IQuerySegment left, IQuerySegment right)
        {
            if (type == ExpressionType.Coalesce)
            {
                return(new FuncBinaryOperation("ISNULL", left, right));
            }

            if (type == ExpressionType.Power)
            {
                return(new FuncBinaryOperation("POWER", left, right));
            }

            return(null);
        }
        public static IQuerySegment TryGet(ExpressionType type, IQuerySegment left, IQuerySegment right)
        {
            if (type == ExpressionType.AndAlso)
            {
                return(new LogicalBinaryOperation(" AND ", left, right));
            }

            if (type == ExpressionType.OrElse)
            {
                return(new LogicalBinaryOperation(" OR ", left, right));
            }

            return(null);
        }
        public ProcessedQuerySegment(IWalkThroughStrings stringNavigator, IQuerySegment querySegment)
        {
            if (stringNavigator == null)
            {
                throw new ArgumentNullException("stringNavigator");
            }
            if (querySegment == null)
            {
                throw new ArgumentNullException("querySegment");
            }

            StringNavigator = stringNavigator;
            QuerySegment    = querySegment;
        }
        /// <summary>
        /// This will never return null but may return an empty set if no matches could be made. An exception will be raised for a null querySegment
        /// reference of if the request could otherwise not be satisfied (eg. unsupported IQuerySegment implementation)
        /// </summary>
        public NonNullImmutableList <WeightedEntry <TKey> > GetMatches(IQuerySegment querySegment)
        {
            if (querySegment == null)
            {
                throw new ArgumentNullException("querySegment");
            }

            var combiningQuerySegment = querySegment as CombiningQuerySegment;

            if (combiningQuerySegment != null)
            {
                return(Reduce(combiningQuerySegment.Segments));
            }

            return(Reduce(new NonNullImmutableList <IQuerySegment>(new IQuerySegment[] { querySegment })));
        }
Esempio n. 8
0
 private FuncBinaryOperation(string operation, IQuerySegment left, IQuerySegment right)
 {
     m_operation = operation;
     m_left      = left;
     m_right     = right;
 }
Esempio n. 9
0
 public NotOperation(IQuerySegment operand)
 {
     m_operand = operand;
 }
Esempio n. 10
0
 public LikeSegment(IQuerySegment mappedLeft, IQuerySegment mappedRight)
 {
     m_mappedLeft  = mappedLeft;
     m_mappedRight = mappedRight;
 }
 private LogicalBinaryOperation(string symbol, IQuerySegment left, IQuerySegment right)
 {
     m_symbol = symbol;
     m_left   = left;
     m_right  = right;
 }
Esempio n. 12
0
 public WhereSegment(IQuerySegment condition)
 {
     m_condition = condition;
 }
Esempio n. 13
0
 public InSubquerySegment(IQuerySegment operand, IQuerySegment itemsSegment)
 {
     m_operand      = operand;
     m_itemsSegment = itemsSegment;
 }
Esempio n. 14
0
        internal static IQuerySegment TryGet(ExpressionType type, IQuerySegment left, IQuerySegment right)
        {
            string symbol;

            return(!s_supportedSymbols.TryGetValue(type, out symbol) ? null : new MathBinaryOperation(symbol, left, right));
        }
Esempio n. 15
0
 public InCsvSegment(IQuerySegment subject, IEnumerable items)
 {
     m_subject = subject;
     m_items   = items;
 }
Esempio n. 16
0
 public CastOperation(Type targetType, IQuerySegment operand)
 {
     m_targetType = targetType;
     m_operand    = operand;
 }