Beispiel #1
0
 public DType Accept(TDouble type, string x)
 {
     if (double.TryParse(x, out var b))
     {
         return(DDouble.ValueOf(b));
     }
     else
     {
         throw new Exception($"{x} 不是double类型");
     }
 }
        public DType Accept(TDouble type, ExcelStream x)
        {
            var d = x.Read();

            if (CheckNull(type.IsNullable, d))
            {
                return(null);
            }
            if (!double.TryParse(d.ToString(), out var v))
            {
                throw new InvalidExcelDataException($"{d} 不是 double 类型值");
            }
            return(DDouble.ValueOf(v));
        }
Beispiel #3
0
 public DType Accept(TDouble type, XElement x, DefAssembly ass)
 {
     return(DDouble.ValueOf(double.Parse(x.Value.Trim())));
 }
Beispiel #4
0
 public DType Accept(TDouble type, JsonElement x, DefAssembly ass)
 {
     return(DDouble.ValueOf(x.GetDouble()));
 }