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

            if (CheckNull(type.IsNullable, d))
            {
                return(null);
            }
            if (!short.TryParse(d.ToString(), out short v))
            {
                throw new InvalidExcelDataException($"{d} 不是 short 类型值");
            }
            return(DFshort.ValueOf(v));
        }
Beispiel #3
0
 public DType Accept(TFshort type, XElement x, DefAssembly ass)
 {
     return(DFshort.ValueOf(short.Parse(x.Value.Trim())));
 }
 public DType Accept(TFshort type, object x, DefAssembly ass)
 {
     return(DFshort.ValueOf((short)(int)x));
 }
Beispiel #5
0
 public DType Accept(TFshort type, JsonElement x, DefAssembly ass)
 {
     return(DFshort.ValueOf(x.GetInt16()));
 }