public DecimalEngine() { var operators = Enum.GetValues(typeof(DecimalOperator)).Cast <DecimalOperator>().ToList().OrderBy(v => (int)v); _minDecimalOperator = (DecimalOperator)Enum.Parse(typeof(DecimalOperator), operators.First().ToString()); _maxDecimalOperator = (DecimalOperator)Enum.Parse(typeof(DecimalOperator), operators.Last().ToString()); }
public DecimalProblem(double number, DecimalOperator decimalOperator, Operation operation, int decimalPlacesInNumber) { Number = number; OperatorIndex = decimalOperator; ProblemOperation = operation; DecimalPlacesInNumber = decimalPlacesInNumber; Answer = null; }
public static int GetDecimalIndexFromDecimalOperatorEnum(DecimalOperator operatorIndex) { string operatorIndexValue = typeof(DecimalOperator).GetMember(operatorIndex.ToString()).First().GetCustomAttributesData().First().NamedArguments.First().TypedValue.Value.ToString(); return(int.Parse(operatorIndexValue)); }
public DecimalEngine(DecimalOperator minDecimalOperator, DecimalOperator maxDecimalOperator) { _minDecimalOperator = minDecimalOperator; _maxDecimalOperator = maxDecimalOperator; }