public void SaveSettings(string jsonSettings, string powertoy = DefaultModuleName, string fileName = DefaultFileName) { try { if (jsonSettings != null) { if (!SettingsFolderExists(powertoy)) { CreateSettingsFolder(powertoy); } _ioProvider.WriteAllText(GetSettingsPath(powertoy, fileName), jsonSettings); } } catch (Exception e) { Logger.LogError($"Exception encountered while saving {powertoy} settings.", e); #if DEBUG if (e is ArgumentException || e is ArgumentNullException || e is PathTooLongException) { throw e; } #endif } }
// Save settings to a json file. public void SaveSettings(string jsonSettings, string powertoy = DefaultModuleName, string fileName = DefaultFileName) { try { if (jsonSettings != null) { if (!SettingsFolderExists(powertoy)) { CreateSettingsFolder(powertoy); } _ioProvider.WriteAllText(GetSettingsPath(powertoy, fileName), jsonSettings); } } catch { } }