public void ChangeLastOperation(Operation op) { if(operations.Count != 0) operations[operations.Count - 1] = op; }
private double Calculate(Operation op, double left, double right) { switch (op) { case Operation.Plus: return left + right; case Operation.Minus: return left - right; case Operation.Mult: return left * right; case Operation.Div: return left / right; default: return double.PositiveInfinity; } }
public void AddOperation(Operation op) { operations.Add(op); }