Class NullableConverter<T>
A converter for a System.Nullable<T>.
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.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 System.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 |
System.Object | parent | the object which will own the created object |
Returns
Type | Description |
---|---|
System.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 |
---|---|---|
System.Nullable<T> | obj | the value to serialize |
System.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)