Show / Hide Table of Contents

# Class NullableConverter<T>

A converter for a Nullable<T>.

##### Inheritance

Object
ValueConverter<Nullable<T>>
NullableConverter<T>
NullableConverter<T, TConverter>

##### Implements

IValueConverter

##### Inherited Members

ValueConverter<Nullable<T>>.IValueConverter.ToValue(Object, Object)
ValueConverter<Nullable<T>>.IValueConverter.FromValue(Value, Object)
ValueConverter<Nullable<T>>.IValueConverter.Type
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()

###### Namespace: IPA.Config.Stores.Converters

###### Assembly: IPA.Loader.dll

##### Syntax

    public class NullableConverter<T> : ValueConverter<T?>, IValueConverter where T : struct

##### Type Parameters

Name | Description
--- | ---
T | the underlying type of the Nullable<T>

### Constructors

| Improve this Doc View Source

#### NullableConverter()

Creates a converter with the default converter for the base type. Equivalent to

    new NullableConverter(Converter<T>.Default)

##### Declaration

    public NullableConverter()

##### See Also

NullableConverter(ValueConverter<T>)
Default
| Improve this Doc View Source

#### NullableConverter(ValueConverter<T>)

Creates a converter with the given underlying ValueConverter<T>.

##### Declaration

    public NullableConverter(ValueConverter<T> underlying)

##### Parameters

Type | Name | Description
--- | --- | ---
ValueConverter<T> | underlying | the undlerlying ValueConverter<T> to use

### Methods

| Improve this Doc View Source

#### FromValue(Value, Object)

Converts a Value tree to a value.

##### Declaration

    public override T? FromValue(Value value, object parent)

##### Parameters

Type | Name | Description
--- | --- | ---
Value | value | the Value tree to convert
Object | parent | the object which will own the created object

##### Returns

Type | Description
--- | ---
Nullable<T> | the object represented by `value`

##### Overrides

IPA.Config.Stores.ValueConverter<System.Nullable<T>>.FromValue(IPA.Config.Data.Value, System.Object)
| Improve this Doc View Source

#### ToValue(Nullable<T>, Object)

Converts a nullable `T` to a Value tree.

##### Declaration

    public override Value ToValue(T? obj, object parent)

##### Parameters

Type | Name | Description
--- | --- | ---
Nullable<T> | obj | the value to serialize
Object | parent | the object which owns `obj`

##### Returns

Type | Description
--- | ---
Value | a Value tree representing `obj`.

##### Overrides

IPA.Config.Stores.ValueConverter<System.Nullable<T>>.ToValue(System.Nullable<T>, System.Object)

### Implements

IValueConverter

### Extension Methods

ReflectionUtil.SetField<T, U>(T, String, U)
ReflectionUtil.GetField<U, T>(T, String)
ReflectionUtil.SetProperty<T, U>(T, String, U)
ReflectionUtil.GetProperty<U, T>(T, String)
ReflectionUtil.InvokeMethod<U, T>(T, String, Object[])