protected override object EvaluationInternal(IDictionary <object, object> parameters) { var left = LeftOprand.Evaluation(parameters); var right = rightOprand.Evaluation(parameters); if (left == null || right == null) { return(null); } if (left == ExpressionConstants.Unevaluatable || right == ExpressionConstants.Unevaluatable) { return(ExpressionConstants.Unevaluatable); } var pair = ExprEvalUtils.ConvertNum2SameLevel(left, right); return(ExprEvalUtils.Calculate(this, pair.Key, pair.Value)); }
protected override object EvaluationInternal(IDictionary <object, object> parameters) { var left = LeftOprand.Evaluation(parameters); var right = rightOprand.Evaluation(parameters); if (left == null || right == null) { return(null); } if (left == ExpressionConstants.Unevaluatable || right == ExpressionConstants.Unevaluatable) { return(ExpressionConstants.Unevaluatable); } var b1 = ExprEvalUtils.Obj2bool(left); var b2 = ExprEvalUtils.Obj2bool(right); return(b1 != b2 ? LiteralBoolean.True : LiteralBoolean.False); }
protected override object EvaluationInternal(IDictionary <object, object> parameters) { object left = LeftOprand.Evaluation(parameters); object right = RightOprand.Evaluation(parameters); if (left == null || right == null) { return(null); } if (left == UnEvaluatable || right == UnEvaluatable) { return(UnEvaluatable); } bool b1 = false, b2 = false; if (Boolean.TryParse(left.ToString(), out b1) && Boolean.TryParse(right.ToString(), out b2)) { return(b1 != b2 ? LiteralBoolean.TRUE : LiteralBoolean.FALSE); } return(LiteralBoolean.FALSE); }
public override object Evaluation(IDictionary <object, object> parameters) { var left = LeftOprand.Evaluation(parameters); var right = rightOprand.Evaluation(parameters); if (left == null || right == null) { return(null); } if (left == ExpressionConstants.Unevaluatable || right == ExpressionConstants.Unevaluatable) { return(ExpressionConstants.Unevaluatable); } if (left is Number || right is Number) { var pair = ExprEvalUtils.ConvertNum2SameLevel(left, right); left = pair.Key; right = pair.Value; } return(left.Equals(right) ? LiteralBoolean.True : LiteralBoolean.False); }