public void Reset(double Number) { CurrentValue = Number; InputWaited = WaitedInput.Action; _Right = null; Action = null; }
private void ExecuteAction() { if (Action == null) throw new Exception("action not set"); CurrentValue = Action.Calculate(CurrentValue, _Right); _Right = null; Action = null; InputWaited = WaitedInput.Action; }
public void InputAction(ICalculatorAction Action) { if (InputWaited != WaitedInput.Action) throw new Exception("action input requered"); if (Action == null) throw new ArgumentNullException("Action"); this.Action = Action; if (Action.Unary) ExecuteAction(); else InputWaited = WaitedInput.Numeric; }