AK.F1.Timing.UI.Converters.PostedTimeTypeToBrushConverter.Convert C# (CSharp) Метод

Convert() публичный Метод

public Convert ( object value, Type targetType, object parameter, CultureInfo culture ) : object
value object
targetType System.Type
parameter object
culture System.Globalization.CultureInfo
Результат object
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if(value == null)
            {
                return Brushes.Black;
            }

            switch((PostedTimeType)value)
            {
                case PostedTimeType.Normal:
                    return Brushes.White;
                case PostedTimeType.PersonalBest:
                    return Brushes.LimeGreen;
                case PostedTimeType.SessionBest:
                    return Brushes.Magenta;
                default:
                    throw new ArgumentOutOfRangeException("value");
            }
        }
PostedTimeTypeToBrushConverter