本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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