public static Expression TryConvert(DecompilerContext context, Expression expr) { Expression converted = new ExpressionTreeConverter(context).Convert(expr); if (converted != null) { converted.AddAnnotation(new ExpressionTreeLambdaAnnotation()); } return(converted); }
public override object VisitInvocationExpression(InvocationExpression invocationExpression, object data) { if (context.Settings.ExpressionTrees && ExpressionTreeConverter.CouldBeExpressionTree(invocationExpression)) { Expression converted = ExpressionTreeConverter.TryConvert(context, invocationExpression); if (converted != null) { invocationExpression.ReplaceWith(converted); return(converted.AcceptVisitor(this, data)); } } return(base.VisitInvocationExpression(invocationExpression, data)); }
public static Expression TryConvert(DecompilerContext context, Expression expr) { Expression converted = new ExpressionTreeConverter(context).Convert(expr); if (converted != null) { converted.AddAnnotation(new ExpressionTreeLambdaAnnotation()); } return converted; }