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); } }
public async void writeCollection(API_InternalFile file, Settings_Config collection) { string json = JsonConvert.SerializeObject(collection, Formatting.Indented); await file.writeText("settings.json", json); }