public static void Create() { if (UserConfigService.Encrypted) File.WriteAllText(FILENAME, EncryptionService.AesEncryptString(JsonConvert.SerializeObject(new AlertConfig()))); else File.WriteAllText(FILENAME, JsonConvert.SerializeObject(new AlertConfig())); Load(); }
public static void Save(string portfolio, List <CoinConfig> coinConfigs) { portfolio += FILEEXTENSION; if (UserConfigService.Encrypted) { File.WriteAllText(portfolio, EncryptionService.AesEncryptString(JsonConvert.SerializeObject(coinConfigs))); } else { File.WriteAllText(portfolio, JsonConvert.SerializeObject(coinConfigs)); } }
public static void ToggleEncryption() { foreach (var portfolio in GetPortfolios()) { if (UserConfigService.Encrypted) { File.WriteAllText(portfolio.FileName, JsonConvert.SerializeObject(LoadEncrypted(portfolio.FileName))); } else { File.WriteAllText(portfolio.FileName, EncryptionService.AesEncryptString(JsonConvert.SerializeObject(LoadUnencrypted(portfolio.FileName)))); } } }
public static void Save() { if (UserConfigService.Encrypted) { File.WriteAllText(FILENAME, EncryptionService.AesEncryptString(JsonConvert.SerializeObject(AlertConfig))); } else { SendAddress = string.Empty; SendPassword = string.Empty; ReceiveAddress = string.Empty; ReceiveType = string.Empty; File.WriteAllText(FILENAME, JsonConvert.SerializeObject(AlertConfig)); } }