public static TypeReader GetReader(Type type)
        {
            Type baseType    = Enum.GetUnderlyingType(type);
            var  constructor = typeof(EnumTypeReader <>).MakeGenericType(baseType).GetTypeInfo().DeclaredConstructors.First();

            return((TypeReader)constructor.Invoke(new object[] { type, PrimitiveParsers.Get(baseType) }));
        }
예제 #2
0
 public SimpleTypeReader()
 {
     _tryParse = PrimitiveParsers.Get <T>();
 }