RestImageResize/Utils/SmartConvert.cs
/// <summary>
/// Converts the string value to bool value.
/// </summary>
/// <param name="value">The value to convert.</param>
/// <returns>
/// The conversion result value.
/// </returns>
Converts the string value to bool value.
Converts the string value to bool value .
private static bool ConvertStringToBool(string value)
        {
            if (TrueStringValues.Contains(value, StringComparer.InvariantCultureIgnoreCase))
            {
                return true;
            }
            if (FalseStringValues.Contains(value, StringComparer.InvariantCultureIgnoreCase))
            {
                return false;
            }
            throw new InvalidCastException(string.Format("Unable to cast {0} value to Boolean.", value));
        }
private static bool ConvertStringToBool ( string value ) { if ( TrueStringValues . Contains ( value , StringComparer . InvariantCultureIgnoreCase ) ) { return true ; } if ( FalseStringValues . Contains ( value , StringComparer . InvariantCultureIgnoreCase ) ) { return false ; } throw new InvalidCastException ( string . Format ( " " , value ) ) ; }
Converts the string value to bool value.
Converts the string value to bool value .
The conversion result value.
The conversion result value .
value
string
The value to convert.
The value to convert .