Example #1
0
        public void Reset(double Number)
        {
            CurrentValue = Number;
            InputWaited = WaitedInput.Action;

            _Right = null;
            Action = null;
        }
Example #2
0
        private void ExecuteAction()
        {
            if (Action == null)
                throw new Exception("action not set");

            CurrentValue = Action.Calculate(CurrentValue, _Right);

            _Right = null;
            Action = null;
            InputWaited = WaitedInput.Action;
        }
Example #3
0
        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;
        }