Ejemplo n.º 1
0
        public object GetGenericValue(ICell cell, TypeInfo type)
        {
            if (ReadHelper.IsLinkCell(cell))
            {
                switch (type.genericType.sign)
                {
                case TypeInfo.Sign.Array:
                    return(ReadLinkArray(cell, type.genericArguments[0]));

                case TypeInfo.Sign.List:
                    return(ReadLinkList(cell, type.genericArguments[0]));

                case TypeInfo.Sign.Dictionary:
                    return(ReadLinkDict(cell, null));

                default:
                    return(null);
                }
            }
            else
            {
                if (cell != null)
                {
                    //as json data
                    return(Newtonsoft.Json.JsonConvert.DeserializeObject(cell.StringCellValue, type.ToSystemType()));
                }
                else
                {
                    return(null);
                }
            }
        }
Ejemplo n.º 2
0
 public object GetObjectValue(ICell cell, TypeInfo type)
 {
     if (ReadHelper.IsLinkCell(cell))
     {
         return(ReadLinkObject(cell, type));
     }
     else
     {
         //as json data
         return(Newtonsoft.Json.JsonConvert.DeserializeObject(cell.StringCellValue, type.ToSystemType()));
     }
 }