Class EnumConverter<T>
A converter for an enum of type T
, that converts the enum to its string representation and back.
Implements
Inherited Members
Namespace: IPA.Config.Stores.Converters
Assembly: IPA.Loader.dll
Syntax
public sealed class EnumConverter<T> : ValueConverter<T>, IValueConverter where T : Enum
Type Parameters
Name | Description |
---|---|
T | the enum type |
Methods
| Improve this Doc View SourceFromValue(Value, Object)
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 | a Text node representing |
Overrides
IPA.Config.Stores.ValueConverter<T>.ToValue(T, System.Object)