Class NullableConverter<T>
A converter for a Nullable<T>.
Inheritance
NullableConverter<T>
Implements
Inherited Members
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 SourceNullableConverter()
Creates a converter with the default converter for the base type. Equivalent to
new NullableConverter(Converter<T>.Default)
Declaration
public NullableConverter()
See Also
| Improve this Doc View SourceNullableConverter(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 SourceFromValue(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 |
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 |
Returns
Type | Description |
---|---|
Value | a Value tree representing |
Overrides
IPA.Config.Stores.ValueConverter<System.Nullable<T>>.ToValue(System.Nullable<T>, System.Object)