예제 #1
0
        public override object Convert(object v, Type t, object p, CultureInfo c)
        {
            var duration = DoubleValueConverter.ToDouble(v, c);
            var cs       = (int)((duration - (int)duration) * 100);
            var sec      = ((int)duration % 60);
            var min      = ((int)duration / 60) % 60;
            var hr       = (int)duration / 3600;

            return($"{hr:00}:{min:00}:{sec:00}.{cs:00}");
        }
예제 #2
0
 public override object Convert(object v, Type t, object p, CultureInfo c) => double.IsNaN(DoubleValueConverter.ToDouble(v));
예제 #3
0
 protected MathConverter([NotNull] Func <double, double> To, [CanBeNull] Func <double, double> From = null)
     : this
     (
         (v, t, p, c) => To(DoubleValueConverter.ToDouble(v)),
         From is null
             ? new Func <object, Type, object, CultureInfo, object>(
예제 #4
0
        public override object Convert(object v, Type t, object p, CultureInfo c)
        {
            var value = DoubleValueConverter.ToDouble(v);

            return(value * -1);
        }