You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Saves the value of the text param to the settings file.
/// </summary>
/// <param name="text">value of all text to be saved to the settings file.</param>
protected void SaveFile(string text)
{
var filePath = CommonHelper.MapPath(DataSettingsFilePath);
//create file if not exists
Expand All
@@ -113,12 +148,23 @@ public virtual void SaveSettings(DataSettings settings)
//we use 'using' to close the file after it's created
using (File.Create(filePath)) { }
}
//save data settings to the file
var text = JsonConvert.SerializeObject(Singleton<DataSettings>.Instance, Formatting.Indented);
File.WriteAllText(filePath, text);
}
#endregion
/// <summary>
/// Will call SaveSettings() as needed when the EncryptStringSettings method does not match the state of the current datasettings object. Used when the user manually edits the value of EncryptStringSettings in the settings file.
if (Singleton<DataSettings>.Instance.EncryptStringSettings && Singleton<DataSettings>.Instance.HasAnyDecryptedDataSettings()) //If it's not encrypted and should be, then encrypt it.
{
SaveSettings(Singleton<DataSettings>.Instance);
}
else if (!Singleton<DataSettings>.Instance.EncryptStringSettings && !Singleton<DataSettings>.Instance.HasAnyEncryptedDataSettings()) //If it's encrypted and it should not be, then decrypt it.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.