Example #1
0
 protected override System.Linq.Expressions.Expression VisitConstant(ConstantExpression c)
 {
     foreach (var atom in c.ToString().Select(ch => new CharAtom(ch,Formula.TextStyle)))
     {
         Formula.Add(atom);
     }
     return base.VisitConstant(c);
 }
 protected override Expression VisitConstant(ConstantExpression c)
 {
     if (c.Value is IQueryable)
     {
         // Assume constant nodes implementing IQueryable 
         // are Images enums
         return c;
     }
     throw new NotSupportedException(
         string.Format(
             "The constant for '{0}' is not supported",
             c.ToString()));
 }
 protected override Expression VisitConstant(ConstantExpression node)
 {
     if (node.Value is bool)
     {
         var value = (bool) node.Value;
         _expression = new LogicValue(value);
     }
     else
     {
         throw new NotSupportedException(node.ToString());
     }
     return node;
 }
        protected override Expression VisitConstant(ConstantExpression c)
        {
            if (!c.Type.IsSubclassOf(typeof(Expression)))
                return base.VisitConstant(c);

            if (_Log.IsDebugEnabled)
                _Log.DebugFormat("Found reducible constant: {0}", c.ToString());

            var result = Visit(c.Value as Expression);

            if (_Log.IsDebugEnabled)
                _Log.DebugFormat("Reduced to: {0}", result.ToString());

            return result;
        }
Example #5
0
            internal override Expression VisitConstant(ConstantExpression c)
            {
                if (ClientType.CheckElementTypeIsEntity(c.Type))
                {
                    throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, c.ToString()));
                }

                return base.VisitConstant(c);
            }
Example #6
0
 internal override Expression VisitConstant(ConstantExpression c)
 {
     throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, c.ToString()));
 }
            internal override Expression VisitConstant(ConstantExpression c)
            {
                if (CommonUtil.IsClientType(c.Type))
                {
                    throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, SR.ALinqExpressionNotSupportedInProjection, this.type, c.ToString()));
                }

                return base.VisitConstant(c);
            }
 internal override Expression VisitConstant(ConstantExpression c)
 {
     throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, SR.ALinqExpressionNotSupportedInProjectionToEntity, this.type, c.ToString()));
 }
Example #9
0
 internal override Expression VisitConstant(ConstantExpression c)
 {
     if (ClientTypeUtil.TypeOrElementTypeIsEntity(c.Type))
     {
         throw new NotSupportedException(System.Data.Services.Client.Strings.ALinq_ExpressionNotSupportedInProjection(this.type, c.ToString()));
     }
     return base.VisitConstant(c);
 }
 internal static double GetDoubleConstant(ConstantExpression constant)
 {
     switch (Type.GetTypeCode(constant.Value.GetType()))
     {
         case TypeCode.Double:
             return (double)constant.Value;
         default:
             throw new NotSupportedException(string.Format("Constant {0} is of a non supported type ({1})", constant.ToString(), constant.Value.GetType().Name));
     }
 }
 internal static int GetIntConstant(ConstantExpression constant)
 {
     switch (Type.GetTypeCode(constant.Value.GetType()))
     {
         case TypeCode.Int16:
             return (int)(Int16)constant.Value;
         case TypeCode.Int32:
             return (int)constant.Value;
         default:
             throw new NotSupportedException(string.Format("Constant {0} is of a non supported type ({1})", constant.ToString(), constant.Value.GetType().Name));
     }
 }