Пример #1
0
 public DType Accept(TShort type, string x)
 {
     if (short.TryParse(x, out var b))
     {
         return(DShort.ValueOf(b));
     }
     else
     {
         throw new Exception($"{x} 不是short类型");
     }
 }
        public DType Accept(TShort 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(DShort.ValueOf(v));
        }
Пример #3
0
        public DType Accept(TShort type, object converter, ExcelStream x, DefAssembly ass)
        {
            var d = x.Read();

            if (CheckNull(type.IsNullable, d))
            {
                return(null);
            }
            if (!short.TryParse(d.ToString(), out short v))
            {
                throw new Exception($"{d} 不是 short 类型值");
            }
            return(new DShort(v));
        }
Пример #4
0
 public override string Accept(TShort type)
 {
     return("Short");
 }
Пример #5
0
 public string Accept(TShort type, string x)
 {
     return(x);
 }
Пример #6
0
 public string Accept(TShort type)
 {
     return("readShort");
 }
Пример #7
0
 public string Accept(TShort type)
 {
     return("SHORT");
 }
 public virtual void Accept(TShort type, T x)
 {
     DoAccept(type, x);
 }
Пример #9
0
 public DType Accept(TShort type, Sheet.NamedRow x, bool multirow, bool nullable)
 {
     throw new NotSupportedException();
 }
Пример #10
0
 public string Accept(TShort type, string fieldName, string tablesName)
 {
     throw new NotImplementedException();
 }
Пример #11
0
 public DType Accept(TShort type, IEnumerable <ExcelStream> x, bool y, DefAssembly ass)
 {
     throw new NotImplementedException();
 }
Пример #12
0
 public DType Accept(TShort type, object x, DefAssembly ass)
 {
     return(DShort.ValueOf((short)(int)x));
 }
Пример #13
0
 public DType Accept(TShort type, object x, DefAssembly ass)
 {
     return(new DShort((short)(int)x));
 }
Пример #14
0
 public string Accept(TShort type, string fieldName, string logType)
 {
     return($"{fieldName} = default;");
 }
Пример #15
0
 public bool Accept(TShort type, TType x, Dictionary <DefTypeBase, bool> y, HashSet <DefTypeBase> z)
 {
     return(true);
 }
Пример #16
0
 public virtual string Accept(TShort type)
 {
     return(type.IsNullable ? "Short" : "short");
 }
Пример #17
0
 public string Accept(TShort type, string json, string field)
 {
     return(DefaultLoad(json, field));
 }
Пример #18
0
 public string Accept(TShort type, string bufName)
 {
     return($"{bufName}.ReadShort()");
 }
Пример #19
0
 public string Accept(TShort type, string jsonVarName, string fieldName)
 {
     return($"{fieldName} = {jsonVarName}");
 }
Пример #20
0
 public virtual TR Accept(TShort type)
 {
     return DoAccept(type);
 }
Пример #21
0
 public string Accept(TShort type)
 {
     return("FJsonValueNumber");
 }
Пример #22
0
 public string Accept(TShort type, string bufName, string fieldName)
 {
     return($"{bufName}.WriteShort({fieldName});");
 }
Пример #23
0
 public string Accept(TShort type, string bufName, string fieldName)
 {
     return($"if(!{bufName}.readShort({fieldName})) return false;");
 }
 public virtual void Accept(TShort type, T x)
 {
 }
 public string Accept(TShort type)
 {
     return("int16");
 }
Пример #26
0
 public string Accept(TShort type)
 {
     return("writeShort");
 }
Пример #27
0
 public void Accept(TShort type, HashSet <DefTypeBase> x)
 {
 }
Пример #28
0
 public void Accept(TShort type, Dictionary <string, DefTypeBase> x)
 {
 }
Пример #29
0
 public string Accept(TShort type, string bufName, string fieldName)
 {
     return($"{fieldName} = {bufName}.ReadShort();");
 }
Пример #30
0
 public DType Accept(TShort type, XElement x, DefAssembly ass)
 {
     return(DShort.ValueOf(short.Parse(x.Value.Trim())));
 }