/// <summary> /// Creates a new <see cref="CSharpAddSubtExpression"/> instance /// with the <paramref name="leftSide"/>, <paramref name="operation"/> and /// <paramref name="rightSide"/> provided. /// </summary> /// <param name="leftSide">The <see cref="ICSharpAddSubtExpression"/> which makes up the /// left operand.</param> /// <param name="operation">The <see cref="CSharpAddSubtOperation"/> that is /// represented by the <see cref="CSharpAddSubtExpression"/>.</param> /// <param name="rightSide">The <see cref="ICSharpMulDivExpression"/> which makes up the /// right operand.</param> /// <exception cref="System.ArgumentOutOfRangeException">thrown when <paramref name="operation"/> is /// <see cref="CSharpAddSubtOperation.Term"/> or is not one of the other elements in the /// <see cref="CSharpAddSubtOperation"/> enumeration.</exception> /// <exception cref="System.ArgumentNullException">thrown when <paramref name="leftSide"/> /// is null; or when <paramref name="rightSide"/> is null.</exception> public CSharpAddSubtExpression(ICSharpAddSubtExpression leftSide, CSharpAddSubtOperation operation, ICSharpMulDivExpression rightSide) : base(leftSide, rightSide) { if (operation == CSharpAddSubtOperation.Term || operation != CSharpAddSubtOperation.Addition && operation != CSharpAddSubtOperation.Subtraction) { throw new ArgumentOutOfRangeException("operation"); } this.operation = operation; }
/// <summary> /// Creates a new <see cref="CSharpAddSubtExpression"/> with the <paramref name="term"/> which will /// be pointed to by the new instance. /// </summary> /// <param name="term">The <see cref="ICSharpMulDivExpression"/> pointed to by the <see cref="CSharpAddSubtExpression"/>.</param> public CSharpAddSubtExpression(ICSharpMulDivExpression term) : base(term) { this.operation = CSharpAddSubtOperation.Term; }