Ejemplo n.º 1
0
 public DType Accept(TByte type, string x)
 {
     if (byte.TryParse(x, out var b))
     {
         return(DByte.ValueOf(b));
     }
     else
     {
         throw new Exception($"{x} 不是byte类型");
     }
 }
        public DType Accept(TByte type, ExcelStream x)
        {
            var d = x.Read();

            if (CheckNull(type.IsNullable, d))
            {
                return(null);
            }
            if (!byte.TryParse(d.ToString(), out byte v))
            {
                throw new InvalidExcelDataException($"{d} 不是 byte 类型值");
            }
            return(DByte.ValueOf(v));
        }
Ejemplo n.º 3
0
        public DType Accept(TByte type, object converter, ExcelStream x, DefAssembly ass)
        {
            var d = x.Read();

            if (CheckNull(type.IsNullable, d))
            {
                return(null);
            }
            if (!byte.TryParse(d.ToString(), out byte v))
            {
                throw new Exception($"{d} 不是 byte 类型值");
            }
            return(new DByte(v));
        }
Ejemplo n.º 4
0
 public DType Accept(TByte type, XElement x, DefAssembly ass)
 {
     return(DByte.ValueOf(byte.Parse(x.Value.Trim())));
 }
Ejemplo n.º 5
0
 public string Accept(TByte type, string bufName)
 {
     return($"{bufName}.ReadByte()");
 }
Ejemplo n.º 6
0
 public string Accept(TByte type, string x)
 {
     return(x);
 }
Ejemplo n.º 7
0
 public override string Accept(TByte type)
 {
     return("Byte");
 }
Ejemplo n.º 8
0
 public string Accept(TByte type, string bufName, string fieldName)
 {
     return($"if(!{bufName}.readByte({fieldName})) return false;");
 }
Ejemplo n.º 9
0
 public string Accept(TByte type)
 {
     return("readByte");
 }
Ejemplo n.º 10
0
 public string Accept(TByte type, string jsonVarName, string fieldName)
 {
     return($"{fieldName} = {jsonVarName}");
 }
Ejemplo n.º 11
0
 public string Accept(TByte type)
 {
     return("FJsonValueNumber");
 }
Ejemplo n.º 12
0
 public virtual string Accept(TByte type)
 {
     return(type.IsNullable ? "Byte" : "byte");
 }
Ejemplo n.º 13
0
 public string Accept(TByte type, string json, string field)
 {
     return(DefaultLoad(json, field));
 }
Ejemplo n.º 14
0
 public DType Accept(TByte type, IEnumerable <ExcelStream> x, bool y, DefAssembly ass)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 15
0
 public DType Accept(TByte type, object x, DefAssembly ass)
 {
     return(DByte.ValueOf((byte)(int)x));
 }
Ejemplo n.º 16
0
 public DType Accept(TByte type, object x, DefAssembly ass)
 {
     return(new DByte((byte)(int)x));
 }
Ejemplo n.º 17
0
 public string Accept(TByte type, string fieldName, string logType)
 {
     return($"{fieldName} = default;");
 }
Ejemplo n.º 18
0
 public bool Accept(TByte type, TType x, Dictionary <DefTypeBase, bool> y, HashSet <DefTypeBase> z)
 {
     return(true);
 }
Ejemplo n.º 19
0
 public string Accept(TByte type, string fieldName, string tablesName)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 20
0
 public virtual TR Accept(TByte type)
 {
     return DoAccept(type);
 }
Ejemplo n.º 21
0
 public DType Accept(TByte type, Sheet.NamedRow x, bool multirow, bool nullable)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 22
0
 public string Accept(TByte type, string bufName, string fieldName)
 {
     return($"{bufName}.WriteByte({fieldName});");
 }
 public virtual void Accept(TByte type, T x)
 {
     DoAccept(type, x);
 }
Ejemplo n.º 24
0
 public string Accept(TByte type)
 {
     return("uint8");
 }
Ejemplo n.º 25
0
 public string Accept(TByte type)
 {
     return("BYTE");
 }
 public virtual void Accept(TByte type, T x)
 {
 }
Ejemplo n.º 27
0
 public void Accept(TByte type, HashSet <DefTypeBase> x)
 {
 }
Ejemplo n.º 28
0
 public string Accept(TByte type)
 {
     return("writeByte");
 }
Ejemplo n.º 29
0
 public string Accept(TByte type, string bufName, string fieldName)
 {
     return($"{fieldName} = {bufName}.ReadByte();");
 }
Ejemplo n.º 30
0
 public void Accept(TByte type, Dictionary <string, DefTypeBase> x)
 {
 }