Exemple #1
0
 /// <summary>
 /// Created default config to specified path
 /// </summary>
 public virtual void DefaultConfig(string configName)
 {
     if (File.Exists(configName))
     {
         return;
     }
     JSONConfigManager.WriteFile(Settings, configName);
 }
Exemple #2
0
 /// <summary>
 /// Creates new configuration if it does not exists
 /// </summary>
 /// <param name="configName">path or name of config</param>
 /// <param name="objToWrite">Object to write</param>
 public static void DefaultConfig <T>(string configName, T objToWrite)
 {
     if (File.Exists(configName))
     {
         return;
     }
     JSONConfigManager.WriteFile(objToWrite, configName);
 }
Exemple #3
0
 /// <summary>
 /// Reads settings from file and stores it into Settings Object
 /// </summary>
 /// <param name="configName">Path of file</param>
 public override void ReadSettingsFromFile(string configName)
 {
     lastConfigName = configName;
     Settings       = JSONConfigManager.ReadFile <T>(configName);
 }
Exemple #4
0
 /// <summary>
 /// Saves Setings object to latest used configuration
 /// </summary>
 /// <returns>return is not required</returns>
 public override byte[] SaveSettings()
 {
     JSONConfigManager.WriteFile(Settings, lastConfigName);
     return(null);
 }
Exemple #5
0
 /// <summary>
 /// Rewrites configuration
 /// </summary>
 public static void RewriteConfiguration <T>(string configFileName, T configs)
 {
     JSONConfigManager.WriteFile(configs, configFileName);
 }
Exemple #6
0
 /// <summary>
 /// Read configuration
 /// </summary>
 public static T ReadConfiguration <T>(string configName) where T : new()
 {
     return(JSONConfigManager.ReadFile <T>(configName));
 }
Exemple #7
0
 /// <summary>
 /// Saves Settings object to specified file
 /// </summary>
 /// <param name="configFileName">Path of file</param>
 public override void SaveSettingsToFile(string configFileName)
 {
     lastConfigName = configFileName;
     JSONConfigManager.WriteFile(Settings, configFileName);
 }