Пример #1
0
        public bool Validate(string value, ref object data)
        {
            var splits = value.Split(',');

            if (splits.Length != 3)
            {
                return(false);
            }

            double min;

            if (!double.TryParse(splits[0], NumberStyles.Float, NumberFormatInfo.InvariantInfo, out min))
            {
                return(false);
            }
            double max;

            if (!double.TryParse(splits[1], NumberStyles.Float, NumberFormatInfo.InvariantInfo, out max))
            {
                return(false);
            }
            double eps;

            if (!double.TryParse(splits[2], NumberStyles.Float, NumberFormatInfo.InvariantInfo, out eps))
            {
                return(false);
            }

            data = new RoundingData(min, max, eps);
            return(true);
        }
Пример #2
0
 public bool Equals(RoundingData other)
 {
     return(Min.Equals(other.Min) && Max.Equals(other.Max) && Epsilon.Equals(other.Epsilon));
 }