mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-11 06:54:58 +03:00
25 lines
781 B
C#
25 lines
781 B
C#
using System.Windows.Data;
|
|
using System.Windows.Media;
|
|
|
|
namespace v2rayN.Converters
|
|
{
|
|
public class DelayColorConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
{
|
|
int.TryParse(value.ToString(), out var delay);
|
|
|
|
if (delay <= 0)
|
|
return new SolidColorBrush(Colors.Red);
|
|
if (delay <= 200)
|
|
return new SolidColorBrush(Colors.Green);
|
|
else
|
|
return new SolidColorBrush(Colors.IndianRed);
|
|
}
|
|
|
|
public object? ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
} |