chore: 统一代码风格
This commit is contained in:
@@ -8,7 +8,7 @@ public class DurationFormatConverter : IValueConverter
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is not double duration) return "--:--";
|
||||
var ts = TimeSpan.FromSeconds(duration);
|
||||
TimeSpan ts = TimeSpan.FromSeconds(duration);
|
||||
if (ts.TotalHours >= 1)
|
||||
return ts.ToString(@"h\:mm\:ss\.ff");
|
||||
return ts.ToString(@"m\:ss\.ff");
|
||||
@@ -40,7 +40,7 @@ public class ChannelsFormatConverter : IValueConverter
|
||||
int ch when ch == 2 => "Stereo",
|
||||
null => "--",
|
||||
int ch => $"{ch}ch",
|
||||
_ => "--"
|
||||
_ => "--",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class PositionFormatConverter : IValueConverter
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is not double pos) return "0:00";
|
||||
var ts = TimeSpan.FromSeconds(pos);
|
||||
TimeSpan ts = TimeSpan.FromSeconds(pos);
|
||||
return ts.ToString(@"m\:ss");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user