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

            if (CheckNull(type.IsNullable, d))
            {
                return(null);
            }
            var ds = d.ToString();

            //if (field?.Remapper is TEnum te)
            //{
            //    if (te.DefineEnum.TryValueByNameOrAlias(ds, out var c))
            //    {
            //        return new DFlong(c);
            //    }
            //}
            if (!long.TryParse(ds, out var v))
            {
                throw new InvalidExcelDataException($"{d} 不是 long 类型值");
            }
            return(DFlong.ValueOf(v));
        }
Example #3
0
 public void Accept(DFlong type, StringBuilder x)
 {
     x.Append(type.Value);
 }
 public int Accept(DFlong data, TType type, Title x)
 {
     SetTitleValue(x, data.Value);
     return(1);
 }
 public void Accept(DFlong type, TType x, List <ResourceInfo> y)
 {
 }
Example #6
0
 public bool Accept(DFlong type)
 {
     return(type.Value == 0);
 }
Example #7
0
 public void Accept(DFlong type, RawTextTable x)
 {
 }
Example #8
0
 public void Accept(DFlong type, ByteBuf x)
 {
     x.WriteFlong(type.Value);
 }
Example #9
0
 public DType Accept(TFlong type, XElement x, DefAssembly ass)
 {
     return(DFlong.ValueOf(long.Parse(x.Value.Trim())));
 }
Example #10
0
 public void Accept(DFlong type, DefField x, List <ResourceInfo> y)
 {
     throw new NotImplementedException();
 }
Example #11
0
 public void Accept(DFlong type, Utf8JsonWriter x)
 {
     x.WriteNumberValue(type.Value);
 }
Example #12
0
 public string Accept(DFlong type)
 {
     return(type.Value.ToString());
 }
Example #13
0
 public void Accept(DFlong type, DefAssembly x)
 {
     throw new NotImplementedException();
 }
Example #14
0
 public void Accept(DFlong type, StringBuilder line)
 {
     line.Append(type.Value);
 }
Example #15
0
 public DType Accept(TFlong type, JsonElement x, DefAssembly ass)
 {
     return(DFlong.ValueOf(x.GetInt64()));
 }