/// <summary> /// Is there a runtime (dynamic) match for the supplied method ? /// </summary> public override bool Matches(MethodInfo method, Type targetType, object[] args) { IExpression expr = Spring.Expressions.Expression.Parse(Expression); MatchingInfoHolder infoHolder = new MatchingInfoHolder(method, targetType, args); try { // Evaluate the expression using the current matching info as current context return (bool)expr.GetValue(infoHolder); } catch (Exception e) { throw new ArgumentException( "Expression cannot be evaluate or not return a boolean.", "Expression", e); } }
/// <summary> /// Is there a runtime (dynamic) match for the supplied method ? /// </summary> public override bool Matches(MethodInfo method, Type targetType, object[] args) { IExpression expr = Spring.Expressions.Expression.Parse(Expression); MatchingInfoHolder infoHolder = new MatchingInfoHolder(method, targetType, args); try { // Evaluate the expression using the current matching info as current context return((bool)expr.GetValue(infoHolder)); } catch (Exception e) { throw new ArgumentException( "Expression cannot be evaluate or not return a boolean.", "Expression", e); } }