private static void CreateDefaultSettingsFile() { var defaultSettings = new SettingStructure(); var newKey = GenerateNewKeypair(); defaultSettings.PrivateKey = newKey.Key; defaultSettings.PublicKey = newKey.Value; LunaXmlSerializer.WriteXml(defaultSettings, SettingsFilePath); }
private static void CreateDefaultSettingsFile() { var defaultSettings = new SettingStructure(); var newKey = GenerateNewKeypair(); defaultSettings.PrivateKey = newKey.Key; defaultSettings.PublicKey = newKey.Value; SaveSettingsToFile(defaultSettings); }
private static void SaveSettingsToFile(SettingStructure settings) { try { using (var w = new XmlTextWriter(SettingsFilePath, null)) { w.Formatting = Formatting.Indented; var serializer = new XmlSerializer(typeof(SettingStructure)); serializer.Serialize(w, settings); } } catch (Exception) { throw new Exception("Could not save settings file."); } }
public static void SaveSettings(SettingStructure currentSettings) { CheckDataDirectory(); LunaXmlSerializer.WriteXml(currentSettings, SettingsFilePath); File.Copy(SettingsFilePath, BackupSettingsFilePath, true); }
public static void SaveSettings(SettingStructure currentSettings) { CheckDataDirectory(); SaveSettingsToFile(currentSettings); File.Copy(SettingsFilePath, BackupSettingsFilePath, true); }
private static void CreateDefaultSettingsFile() { var defaultSettings = new SettingStructure(); LunaXmlSerializer.WriteToXmlFile(defaultSettings, SettingsFilePath); }