Table of Contents

Class StringConverter

Namespace
Loehnert.Lisrt.Modules.Configuration
Assembly
Loehnert.Lisrt.Modules.dll

Converts objects to string and backwards.

[Export(typeof(IStringConverter))]
public class StringConverter : IStringConverter
Inheritance
StringConverter
Implements
Inherited Members
Extension Methods

Remarks

For DateTime: See https://en.wikipedia.org/wiki/ISO_8601 For Nullable: "" and "null" (case insensitive) returns a null. For string with text "null": "null" is always text "null".

Methods

ConvertToObject(string, Type)

Convert string to a given object.

public object ConvertToObject(string value, Type type)

Parameters

value string

Value as string.

type Type

Target type to convert.

Returns

object

An object with the given value and Type.

Exceptions

ArgumentNullException

Thrown value or type is null.

ConvertToString(object)

Convert the value of an object to string.

public string ConvertToString(object value)

Parameters

value object

Any object with value.

Returns

string

string representing the value.