Пример #1
0
        private void ExecApplicationOperation(ApplicationOperationType operation)
        {
            var(newNumbers, historyData) = operation.ApplicationOperation.Operate(CalculationData, HistoricalData);

            if (historyData != null)
            {
                HistoricalData.Push(historyData);
            }

            CalculationData = newNumbers;
        }
Пример #2
0
        private void Operation(InputDto inputDto)
        {
            var operationType =
                Enumeration.FromDisplayName <CalculationOperationType>(inputDto.Input, isThrowException: true);

            try
            {
                var(result, history, resultMemberCount) = operationType.Calculator.Calculate(CalculationData);
                CalculationData = result;
                HistoricalData.Push(new HistoricalData(history, operationType.Name, resultMemberCount));
            }
            catch (ParameterCountNotMatchExceptions e)
            {
                throw new ParameterCountNotMatchExceptions(string.Format(e.Message, inputDto.Index));
            }
        }
Пример #3
0
        private void PushInput(decimal input)
        {
            CalculationData.Push(input);

            HistoricalData.Push(new HistoricalData(new Stack <decimal>(), ApplicationOperationType.Input.Name, 1));
        }