예제 #1
0
        public settingsFile readFromFile()
        {
            string output = File.ReadAllText("settings.json");

            settingsFile deserializedProduct = JsonConvert.DeserializeObject <settingsFile>(output);

            return(deserializedProduct);
        }
예제 #2
0
        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();
        }