Exemplo n.º 1
0
        public static CellListJson LoadJsonFile(string path)
        {
            string jsonText;

            try
            {
                jsonText = File.ReadAllText(path, Encoding.UTF8);
            }
            catch (Exception)
            {
                MessageBox.Show("打开文件错误");
                return(null);
            }
            CellListJson objJson = JsonConvert.DeserializeObject <CellListJson>(jsonText);
            //
            FileStream fs  = new FileStream(path, FileMode.Open);
            string     md5 = GenerateMD5(fs);

            objJson.md5 = md5;
            return(objJson);
        }
Exemplo n.º 2
0
 /// 生成cell list
 private void GenerateCellList(String path)
 {
     json = JsonHelp.LoadJsonFile(path);
     ReloadCellList();
 }
Exemplo n.º 3
0
 public static void ListToFile(CellListJson list, string path)
 {
     ObjToFile(list, list.name + ".cell", path);
 }