public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if(value == null)
{
return string.Empty;
}
switch((DriverStatus)value)
{
case DriverStatus.OnTrack:
return "On Track";
case DriverStatus.InPits:
return "In Pits";
case DriverStatus.Out:
return "Out";
case DriverStatus.Stopped:
return "Stopped";
case DriverStatus.Retired:
return "Retired";
default:
throw Guard.ArgumentOutOfRange("value");
}
}