Esempio n. 1
0
        public T ReadValue(IValueReader valueReader)
        {
            if (valueReader is ValueCopyer copyer && copyer.InternalObject is T ret)
            {
                return(ret);
            }

            if (typeof(T).IsAssignableFrom(typeof(TValue[])))
            {
                return(TypeHelper.As <TValue[], T>(ValueInterface <TValue[]> .ReadValue(valueReader)));
            }
            else if (typeof(T).IsAssignableFrom(typeof(List <TValue>)))
            {
                return(TypeHelper.As <List <TValue>, T>(ValueInterface <List <TValue> > .ReadValue(valueReader)));
            }
            else
            {
                return(XConvert.Convert <TValue[], T>(ValueInterface <TValue[]> .ReadValue(valueReader)));
            }
        }
Esempio n. 2
0
 public float ReadSingle()
 {
     return(TypeHelper.As <int, float>(ReadInt32()));
 }
Esempio n. 3
0
 public double ReadDouble()
 {
     return(TypeHelper.As <long, double>(ReadInt64()));
 }