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
valueobjectA boolean value.
cultureCultureInfoCulture for the returning string (not used).
Returns
- string
'true' or 'false'.
Exceptions
- ArgumentException
Thrown when
valueis not a bool.
ConvertBack(string, CultureInfo)
public object ConvertBack(string value, CultureInfo culture)
Parameters
valuestringBoolean as string.
cultureCultureInfoCulture for the
valueto convert back.
Returns
Exceptions
- ArgumentNullException
Thrown when
valueis null, empty or whitespace.- ArgumentException
Thrown when value does not represents an bool.