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)); }
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)); }
public override string Accept(TFint type) { return("Integer"); }
public string Accept(TFint type, string x) { return(x); }
public string Accept(TFint type) { return("readFint"); }
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(); }
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)); }
public DType Accept(TFint type, object x, DefAssembly ass) { return(new DFint((int)x)); }
public string Accept(TFint type, string fieldName, string logType) { return($"{fieldName} = default;"); }
public bool Accept(TFint type, TType x, Dictionary <DefTypeBase, bool> y, HashSet <DefTypeBase> z) { return(true); }
public virtual string Accept(TFint type) { return(type.IsNullable ? "Integer" : "int"); }
public string Accept(TFint type, string json, string field) { return(DefaultLoad(json, field)); }
public string Accept(TFint type, string bufName) { return($"{bufName}.ReadFint()"); }
public string Accept(TFint type, string jsonVarName, string fieldName) { return($"{fieldName} = {jsonVarName}"); }
public virtual TR Accept(TFint type) { return DoAccept(type); }
public string Accept(TFint type) { return("FJsonValueNumber"); }
public string Accept(TFint type, string bufName, string fieldName) { return($"{bufName}.WriteFint({fieldName});"); }
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"); }
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();"); }
public DType Accept(TFint type, XElement x, DefAssembly ass) { return(DFint.ValueOf(int.Parse(x.Value.Trim()))); }