Table of Contents

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 object

A boolean value.

culture CultureInfo

Culture for the returning string (not used).

Returns

string

'true' or 'false'.

Exceptions

ArgumentException

Thrown when value is not a bool.

ConvertBack(string, CultureInfo)

Converts a string to a bool.

public object ConvertBack(string value, CultureInfo culture)

Parameters

value string

Boolean as string.

culture CultureInfo

Culture for the value to convert back.

Returns

object

The value converted to bool.

Exceptions

ArgumentNullException

Thrown when value is null, empty or whitespace.

ArgumentException

Thrown when value does not represents an bool.