Class BoolToStringConverter
- Namespace
- Loehnert.TypeAndResult.Additional
- Assembly
- Loehnert.TypeAndResult.dll
Converts a boolean to a string and back.
public class BoolToStringConverter : IAdditionalParameterConverter
- Inheritance
-
BoolToStringConverter
- Implements
- Inherited Members
Methods
Convert(object, CultureInfo)
Converts a bool to an equivalent string value.
public string Convert(object value, CultureInfo culture)
Parameters
value
objectA boolean value.
culture
CultureInfoCulture for the returning string (not used).
Returns
- string
'true' or 'false'.
Exceptions
- ArgumentException
Thrown when
value
is not a bool.
ConvertBack(string, CultureInfo)
public object ConvertBack(string value, CultureInfo culture)
Parameters
value
stringBoolean as string.
culture
CultureInfoCulture for the
value
to convert back.
Returns
Exceptions
- ArgumentNullException
Thrown when
value
is null, empty or whitespace.- ArgumentException
Thrown when value does not represents an bool.