private Expression TryRecurseSimplest(Expression expr)
        {
            var binary = SubstituteExpression.Strip(expr) as BinaryExpression;

            if (binary != null)
            {
                var reduced = Analyze(binary);

                return(reduced);
            }

            return(expr);
        }
Example #2
0
        public static bool IsBool(Expression expr)
        {
            expr = SubstituteExpression.Strip(expr);

            return(expr is ConstantExpression && expr.Type == typeof(bool));
        }