当前位置: 首页>>代码示例>>C#>>正文


C# ConstantExpression.ToString方法代码示例

本文整理汇总了C#中System.Linq.Expressions.ConstantExpression.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ConstantExpression.ToString方法的具体用法?C# ConstantExpression.ToString怎么用?C# ConstantExpression.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Linq.Expressions.ConstantExpression的用法示例。


在下文中一共展示了ConstantExpression.ToString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VisitConstant

 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);
 }
开发者ID:Civa,项目名称:Zenith,代码行数:8,代码来源:TexExpressionVisitor.cs

示例2: VisitConstant

 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()));
 }
开发者ID:sandrapatfer,项目名称:PROMPT11-02-AdvancedProgramming.vilhena,代码行数:13,代码来源:ImageQueryTranslator.cs

示例3: VisitConstant

 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;
 }
开发者ID:alex-fomin,项目名称:BLogic,代码行数:13,代码来源:ExpressionTranslator.cs

示例4: VisitConstant

        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;
        }
开发者ID:pruiz,项目名称:nhibernate-contrib-old,代码行数:15,代码来源:ConstantExpressionReducer.cs

示例5: VisitConstant

            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);
            }
开发者ID:JianwenSun,项目名称:cc,代码行数:9,代码来源:ProjectionAnalyzer.cs

示例6: VisitConstant

            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);
            }
开发者ID:huoxudong125,项目名称:azure-sdk-for-net,代码行数:9,代码来源:ProjectionAnalyzer.cs

示例7: VisitConstant

 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);
 }
开发者ID:nickchal,项目名称:pash,代码行数:8,代码来源:ProjectionAnalyzer.cs

示例8: GetDoubleConstant

 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));
     }
 }
开发者ID:sandrapatfer,项目名称:PROMPT11-02-AdvancedProgramming.vilhena,代码行数:10,代码来源:ImageQueryTranslator.cs

示例9: GetIntConstant

 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));
     }
 }
开发者ID:sandrapatfer,项目名称:PROMPT11-02-AdvancedProgramming.vilhena,代码行数:12,代码来源:ImageQueryTranslator.cs


注:本文中的System.Linq.Expressions.ConstantExpression.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。