コード例 #1
0
 public void readSettings()                                                            // Loads settings from the json file
 {
     using (var reader = new StreamReader(settings, false))                            // Create a new reader under the settings file
     {
         string settingsData = reader.ReadToEnd();                                     // Read the whole file
         settingsObject = JsonConvert.DeserializeObject <settingsClass>(settingsData); // Convert from the json format to the settingsClass structure
     }
 }
コード例 #2
0
 public SettingsManager( )                                                                                                      // Constructor
 {
     settings       = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "pub\\settings.json"); // Set the local settings path
     settingsObject = new settingsClass();                                                                                      // Create a new settings object
 }