public DType Accept(TBool type, ExcelStream x)
        {
            var d = x.Read();

            if (CheckNull(type.IsNullable, d))
            {
                return(null);
            }
            return(DBool.ValueOf(CreateBool(d)));
        }
示例#2
0
 public DType Accept(TBool type, string x)
 {
     if (bool.TryParse(x, out var b))
     {
         return(DBool.ValueOf(b));
     }
     else
     {
         throw new Exception($"{x} 不是bool类型");
     }
 }
示例#3
0
 public DType Accept(TBool type, XElement x, DefAssembly ass)
 {
     return(DBool.ValueOf(bool.Parse(x.Value.Trim().ToLower())));
 }
 public DType Accept(TBool type, object x, DefAssembly ass)
 {
     return(DBool.ValueOf((bool)x));
 }
示例#5
0
 public DType Accept(TBool type, JsonElement x, DefAssembly ass)
 {
     return(DBool.ValueOf(x.GetBoolean()));
 }