private void ExecApplicationOperation(ApplicationOperationType operation) { var(newNumbers, historyData) = operation.ApplicationOperation.Operate(CalculationData, HistoricalData); if (historyData != null) { HistoricalData.Push(historyData); } CalculationData = newNumbers; }
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)); } }
private void PushInput(decimal input) { CalculationData.Push(input); HistoricalData.Push(new HistoricalData(new Stack <decimal>(), ApplicationOperationType.Input.Name, 1)); }