Created
October 6, 2015 01:03
-
-
Save droyad/23090df50ade11f63bb2 to your computer and use it in GitHub Desktop.
Config Injector Enum Value parser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class EnumValueParser : IValueParser | |
| { | |
| public bool CanParse(Type settingValueType) | |
| { | |
| return settingValueType.IsEnum; | |
| } | |
| public object Parse(Type settingValueType, string settingValueString) | |
| { | |
| return settingValueString.ToEnum(settingValueType); | |
| } | |
| public int SortOrder => 1; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment