public static FromString ( string speedName ) : |
||
speedName | string | The description of the speed to create. |
return |
public static Speed FromString(string speedName)
{
Speed toReturn = Fast;
if (string.Compare(speedName, "medium", StringComparison.OrdinalIgnoreCase) == 0)
{
toReturn = Medium;
}
if (string.Compare(speedName, "slow", StringComparison.OrdinalIgnoreCase) == 0)
{
toReturn = Slow;
}
return toReturn;
}