示例#1
0
        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());
        }
示例#2
0
 public DecimalProblem(double number, DecimalOperator decimalOperator, Operation operation, int decimalPlacesInNumber)
 {
     Number                = number;
     OperatorIndex         = decimalOperator;
     ProblemOperation      = operation;
     DecimalPlacesInNumber = decimalPlacesInNumber;
     Answer                = null;
 }
示例#3
0
        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));
        }
示例#4
0
 public DecimalEngine(DecimalOperator minDecimalOperator, DecimalOperator maxDecimalOperator)
 {
     _minDecimalOperator = minDecimalOperator;
     _maxDecimalOperator = maxDecimalOperator;
 }