/// <summary> /// finds the distance range /// </summary> private void FillOutDistanceRange() { int min = 0; int max = 0; //go through the types until a valid min max value is found foreach (Task.DistanceRangeType type in Enum.GetValues(typeof(Task.DistanceRangeType))) { if (Task.RangeTypeToMinMax(type, out min, out max)) { if (max == -1)//if max = -1 then it is a MINVALUE - > Infinity range { if (Distance >= min) { _distanceRange = type; return; } } else //minvalue - maxvalue { //if it fits then save the type and break if (Distance <= max && Distance >= min) { _distanceRange = type; return; } } } } }
/// <summary> /// finds the distance range /// </summary> private void FillOutDistanceRange() { int min = 0; int max = 0; //go through the types until a valid min max value is found foreach (Task.DistanceRangeType type in Enum.GetValues(typeof(Task.DistanceRangeType))) { if (Task.RangeTypeToMinMax(type, out min, out max)) { if (max == -1)//if max = -1 then it is a MINVALUE - > Infinity range { if (Distance >= min) { _distanceRange = type; return; } } else //minvalue - maxvalue { //if it fits then save the type and break if (Distance <= max && Distance >= min) { _distanceRange = type; return; } } } } }