public override ExpressionElement Convert(IExpressionConverter converter, NewExpression exp) { var obj = converter.ToObject(exp.Arguments[0]); return (bool)obj ? converter.Convert(exp.Arguments[1]) : (ExpressionElement)string.Empty; }
public override ExpressionElement Convert(IExpressionConverter converter, MethodCallExpression method) { var text = (string)converter.ToObject(method.Arguments[0]); var array = method.Arguments[1] as NewArrayExpression; return new StringFormatText(text, array.Expressions.Select(e => converter.Convert(e)).ToArray()); }