示例#1
0
        public async Task <Settings_Config> readCollection(API_InternalFile file)
        {
            try
            {
                string text = await file.readText("settings.json");

                Settings_Config list = JsonConvert.DeserializeObject <Settings_Config>(text);
                return(list);
            }
            catch (FileNotFoundException ex)
            {
                Settings_Config config = new Settings_Config();
                config.start = 0;

                return(config);
            }
        }
示例#2
0
 public async void writeCollection(API_InternalFile file, Settings_Config collection)
 {
     string json = JsonConvert.SerializeObject(collection, Formatting.Indented);
     await file.writeText("settings.json", json);
 }