protected override object EvaluationInternal(IDictionary <object, object> parameters) { var left = LeftOprand.Evaluation(parameters); var right = rightOprand.Evaluation(parameters); if (left == ExpressionConstants.Unevaluatable || right == ExpressionConstants.Unevaluatable) { return(ExpressionConstants.Unevaluatable); } if (left == null) { return(right == null ? LiteralBoolean.True : LiteralBoolean.False); } if (right == null) { return(LiteralBoolean.False); } 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); }
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)); }
/// <param name="obj1">not null</param> /// <param name="obj2">not null</param> private static bool CompareEvaluatedValue(object obj1, object obj2) { if (obj1.Equals(obj2)) { return(true); } try { var pair = ExprEvalUtils.ConvertNum2SameLevel(obj1, obj2); return(pair.Key.Equals(pair.Value)); } catch (Exception) { return(false); } }