Example #1
0
 public DType Accept(TFint type, string x)
 {
     if (int.TryParse(x, out var b))
     {
         return(DFint.ValueOf(b));
     }
     else
     {
         throw new Exception($"{x} 不是int类型");
     }
 }
        public DType Accept(TFint 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 DFint(c);
            //    }
            //}
            if (!int.TryParse(ds, out var v))
            {
                throw new InvalidExcelDataException($"{d} 不是 int 类型值");
            }
            return(DFint.ValueOf(v));
        }
Example #3
0
        public DType Accept(TFint type, object converter, ExcelStream x, DefAssembly ass)
        {
            var d = x.Read();

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

            if (converter is TEnum te)
            {
                if (te.DefineEnum.TryValueByNameOrAlias(ds, out var c))
                {
                    return(new DFint(c));
                }
            }
            if (!int.TryParse(ds, out var v))
            {
                throw new Exception($"{d} 不是 int 类型值");
            }
            return(new DFint(v));
        }
Example #4
0
 public override string Accept(TFint type)
 {
     return("Integer");
 }
Example #5
0
 public string Accept(TFint type, string x)
 {
     return(x);
 }
Example #6
0
 public string Accept(TFint type)
 {
     return("readFint");
 }
Example #7
0
 public string Accept(TFint type)
 {
     return("FINT");
 }
 public virtual void Accept(TFint type, T x)
 {
     DoAccept(type, x);
 }
 public DType Accept(TFint type, Sheet.NamedRow x, bool multirow, bool nullable)
 {
     throw new NotSupportedException();
 }
 public string Accept(TFint type, string fieldName, string tablesName)
 {
     throw new NotImplementedException();
 }
Example #11
0
 public DType Accept(TFint type, IEnumerable <ExcelStream> x, bool y, DefAssembly ass)
 {
     throw new NotImplementedException();
 }
 public DType Accept(TFint type, object x, DefAssembly ass)
 {
     return(DFint.ValueOf((int)x));
 }
Example #13
0
 public DType Accept(TFint type, object x, DefAssembly ass)
 {
     return(new DFint((int)x));
 }
Example #14
0
 public string Accept(TFint type, string fieldName, string logType)
 {
     return($"{fieldName} = default;");
 }
Example #15
0
 public bool Accept(TFint type, TType x, Dictionary <DefTypeBase, bool> y, HashSet <DefTypeBase> z)
 {
     return(true);
 }
Example #16
0
 public virtual string Accept(TFint type)
 {
     return(type.IsNullable ? "Integer" : "int");
 }
Example #17
0
 public string Accept(TFint type, string json, string field)
 {
     return(DefaultLoad(json, field));
 }
Example #18
0
 public string Accept(TFint type, string bufName)
 {
     return($"{bufName}.ReadFint()");
 }
Example #19
0
 public string Accept(TFint type, string jsonVarName, string fieldName)
 {
     return($"{fieldName} = {jsonVarName}");
 }
Example #20
0
 public virtual TR Accept(TFint type)
 {
     return DoAccept(type);
 }
Example #21
0
 public string Accept(TFint type)
 {
     return("FJsonValueNumber");
 }
Example #22
0
 public string Accept(TFint type, string bufName, string fieldName)
 {
     return($"{bufName}.WriteFint({fieldName});");
 }
Example #23
0
 public string Accept(TFint type, string bufName, string fieldName)
 {
     return($"if(!{bufName}.readFint({fieldName})) return false;");
 }
 public virtual void Accept(TFint type, T x)
 {
 }
 public string Accept(TFint type)
 {
     return("int32");
 }
 public string Accept(TFint type)
 {
     return("writeFint");
 }
Example #27
0
 public void Accept(TFint type, HashSet <DefTypeBase> x)
 {
 }
 public void Accept(TFint type, Dictionary <string, DefTypeBase> x)
 {
 }
 public string Accept(TFint type, string bufName, string fieldName)
 {
     return($"{fieldName} = {bufName}.ReadFint();");
 }
Example #30
0
 public DType Accept(TFint type, XElement x, DefAssembly ass)
 {
     return(DFint.ValueOf(int.Parse(x.Value.Trim())));
 }