Add controls to the VideoPlayer

This commit is contained in:
Paddy Xu
2017-05-08 22:00:25 +03:00
parent 66759992f1
commit 0995ebb7c2
10 changed files with 225 additions and 45 deletions

View File

@@ -0,0 +1,43 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace QuickLook.Plugin.VideoViewer
{
public sealed class DecimalToTimeSpanConverter : DependencyObject, IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
return "00:00:00";
var time = TimeSpan.FromSeconds((double) (decimal) value);
return time.ToString(@"hh\:mm\:ss");
}
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
public sealed class DoubleToTimeSpanConverter : DependencyObject, IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
return "00:00:00";
var time = TimeSpan.FromSeconds((double) value);
return time.ToString(@"hh\:mm\:ss");
}
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}