Beispiel #1
0
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        int.TryParse(value.ToString(), out int time);
        var span = TimeSpan.FromSeconds(time);

        if (string.IsNullOrWhiteSpace(value.ToString()) || span.Equals(TimeSpan.MinValue))
        {
            return(null);
        }
        else
        {
            return(TimeSpanFormatConverter.SecondsToDelay(time));
        }
    }
 public void SetUp()
 {
     Converter = new TimeSpanFormatConverter();
 }