示例#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();
 }
 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");
 }
 public string Accept(TShort type)
 {
     return("writeShort");
 }
示例#27
0
 public void Accept(TShort type, HashSet <DefTypeBase> x)
 {
 }
 public void Accept(TShort type, Dictionary <string, DefTypeBase> x)
 {
 }
 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())));
 }