예제 #1
0
        /// <summary>
        /// Finds the number of objects range
        /// </summary>
        private void FillOutNumberOfObjectsRange()
        {
            int min = 0;
            int max = 0;

            foreach (Task.NumberOfObjectsRangeType type in Enum.GetValues(typeof(Task.NumberOfObjectsRangeType)))
            {
                //go through the types until a valid min max value is found
                if (Task.RangeTypeToMinMax(type, out min, out max))
                {
                    //if max = -1 then it is a MINVALUE - > Infinity range
                    if (max == -1)
                    {
                        //if it fits then save the type and break
                        if (NumberOfObjects >= min)
                        {
                            _numberOfObjectsRange = type;
                            break;
                        }
                    }//else its a min and max
                    else
                    {
                        //if it fits then save the type and break
                        if (NumberOfObjects <= max && NumberOfObjects >= min)
                        {
                            _numberOfObjectsRange = type;
                            break;
                        }
                    }
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Finds the number of objects range
        /// </summary>
        private void FillOutNumberOfObjectsRange()
        {
            int min = 0;
            int max = 0;
            foreach (Task.NumberOfObjectsRangeType type in Enum.GetValues(typeof(Task.NumberOfObjectsRangeType)))
            {
                //go through the types until a valid min max value is found
                if (Task.RangeTypeToMinMax(type, out min, out max))
                {
                    //if max = -1 then it is a MINVALUE - > Infinity range
                    if (max == -1)
                    {
                        //if it fits then save the type and break
                        if (NumberOfObjects >= min)
                        {
                            _numberOfObjectsRange = type;
                            break;
                        }
                    }//else its a min and max
                    else
                    {
                        //if it fits then save the type and break
                        if (NumberOfObjects <= max && NumberOfObjects >= min)
                        {
                            _numberOfObjectsRange = type;
                            break;
                        }
                    }

                }
            }
        }