public settingsFile readFromFile() { string output = File.ReadAllText("settings.json"); settingsFile deserializedProduct = JsonConvert.DeserializeObject <settingsFile>(output); return(deserializedProduct); }
public void saveToFile() { settingsFile file = new settingsFile(); file.directory = pathLocation; file.isDarkMode = false; string output = JsonConvert.SerializeObject(file); StreamWriter outSettings = new StreamWriter("settings.json", false); outSettings.Write(output); outSettings.Close(); }