Exemplo n.º 1
0
        internal void SaveJsonFile(FileStructure fileStructure)
        {
            string path        = GetJsonFilePath();
            string fileContent = Newtonsoft.Json.JsonConvert.SerializeObject(fileStructure);

            System.IO.File.WriteAllText(path, fileContent);
        }
Exemplo n.º 2
0
 internal FileStructure ReadJsonFile()
 {
     if (!JsonFileExists())
     {
         return(new FileStructure());
     }
     else
     {
         string        path          = GetJsonFilePath();
         string        fileContent   = System.IO.File.ReadAllText(path);
         FileStructure fileStructure = Newtonsoft.Json.JsonConvert.DeserializeObject <FileStructure>(fileContent);
         return(fileStructure);
     }
 }