42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
namespace Common.UI.Infrastructure
|
|
{
|
|
using Common.Hardware.SIRT;
|
|
using Common.Hardware.SIRT.Parameters;
|
|
|
|
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
using System.Windows.Media;
|
|
|
|
internal class TaskStateToForegroundBrushConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
var brush = Brushes.Gray;
|
|
|
|
if (value is string label)
|
|
{
|
|
switch (label)
|
|
{
|
|
case nameof(SIRTMessage.BUP): brush = Brushes.Black; break;
|
|
case nameof(SIRTMessage.LAT): brush = Brushes.Black; break;
|
|
case nameof(SIRTMessage.DEBUG): brush = Brushes.Black; break;
|
|
case nameof(PAMStatus.OK): brush = Brushes.Black; break;
|
|
case nameof(PAMStatus.CMD_UNKNOWN): brush = Brushes.Black; break;
|
|
case nameof(PAMStatus.EXPIRED_AUTH): brush = Brushes.Black; break;
|
|
case nameof(PAMStatus.MIXED_TYPES): brush = Brushes.Black; break;
|
|
case nameof(PAMStatus.OUT_OF_RANGE): brush = Brushes.Black; break;
|
|
case nameof(PAMStatus.WRONG_AUTH): brush = Brushes.Black; break;
|
|
}
|
|
}
|
|
|
|
return brush;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|