Class NumericEnumConverter<T>
A converter for an enum of type T
, that converts the enum to its underlying value for serialization.
Implements
Inherited Members
Namespace: IPA.Config.Stores.Converters
Assembly: IPA.Loader.dll
Syntax
public sealed class NumericEnumConverter<T> : ValueConverter<T>, IValueConverter where T : Enum
Type Parameters
Name | Description |
---|---|
T | the enum type |
Methods
| Improve this Doc View SourceFromValue(Value, Object)
Converts a Value that is a numeric node to the corresponding enum value.
Declaration
public override T FromValue(Value value, object parent)
Parameters
Type | Name | Description |
---|---|---|
Value | value | the Value to convert |
Object | parent | the object which will own the created object |
Returns
Type | Description |
---|---|
T | the deserialized enum value |
Overrides
IPA.Config.Stores.ValueConverter<T>.FromValue(IPA.Config.Data.Value, System.Object)
Exceptions
Type | Condition |
---|---|
ArgumentException | if |
ToValue(T, Object)
Converts an enum of type T
to a Value node corresponding to its value.
Declaration
public override Value ToValue(T obj, object parent)
Parameters
Type | Name | Description |
---|---|---|
T | obj | the value to serialize |
Object | parent | the object which owns |
Returns
Type | Description |
---|---|
Value | an Integer node representing |
Overrides
IPA.Config.Stores.ValueConverter<T>.ToValue(T, System.Object)