public ArithmeticBinaryExpression(ArithmeticOperator operation, IExpression left, IExpression right)
: base(left, right)
{
this.operation = operation;
switch (operation)
{
case ArithmeticOperator.Add:
this.function = AddOrConcatenateObjects;
break;
case ArithmeticOperator.Subtract:
this.function = Operators.SubtractObject;
break;
case ArithmeticOperator.Multiply:
this.function = Operators.MultiplyObject;
break;
case ArithmeticOperator.Divide:
this.function = Operators.DivideObject;
break;
case ArithmeticOperator.IntegerDivide:
this.function = Operators.IntDivideObject;
break;
case ArithmeticOperator.Modulo:
this.function = Operators.ModObject;
break;
default:
throw new ArgumentException("Invalid operator");
}
}