public void startSaveDataForList(string fileName, List <T> dataBeanList) { if (fileName == null) { LogUtil.log("保存文件失败-没有文件名称"); return; } if (dataBeanList == null) { LogUtil.log("保存文件失败-没有数据"); return; } ListHandleBean <T> handBean = new ListHandleBean <T>(); handBean.listData = dataBeanList; string strData = JsonUtil.ToJson(handBean); FileUtil.CreateTextFile(Data_Path, fileName, strData); }
public List <T> startLoadDataForList(string fileName) { if (fileName == null) { LogUtil.log("读取文件失败-没有文件名称"); return(null); } string strData = FileUtil.LoadTextFile(Data_Path + "/" + fileName); if (strData == null) { return(null); } ListHandleBean <T> handBean = JsonUtil.FromJson <ListHandleBean <T> >(strData); if (handBean == null) { return(null); } return(handBean.listData); }