public void SaveCurrentConfig() { //Check if the file has somehow became read-only FileInfo newFileInfo = new FileInfo(configPath); if (newFileInfo.Exists) { if ((newFileInfo.Attributes & FileAttributes.ReadOnly) > 0) { newFileInfo.Attributes ^= FileAttributes.ReadOnly; } } else { //Reset(); Config config = new Config(); config.Save(configPath); } currentConfig.Save(configPath); }
public void ApplyDefault() { Config config; if (File.Exists(configPath)) { config = Config.LoadFrom(configPath); } else { config = new Config(); config.Save(configPath); } Apply(config); }
public void Reset() { Config config = new Config(); config.Save(configPath); Apply(config); }