public override object Apply(object leftValue, object rightValue)
{
if (this.operation == ArithmeticOperator.Add)
{
if (leftValue == null)
if (ObjectUtilities.IsNumber(rightValue))
leftValue = 0;
if (rightValue == null)
if (ObjectUtilities.IsNumber(leftValue))
rightValue = 0;
}
else
{
if (leftValue == null)
leftValue = 0;
if (rightValue == null)
rightValue = 0;
}
var result = this.function(leftValue, rightValue);
if (this.operation != ArithmeticOperator.Divide || !(result is double))
return result;
var r = (double)result;
var floor = Math.Floor(r);
if (floor == r)
return (int)floor;
return result;
}