Example #1
0
        private static void CreateDefaultSettingsFile()
        {
            var defaultSettings = new SettingStructure();

            var newKey = GenerateNewKeypair();

            defaultSettings.PrivateKey = newKey.Key;
            defaultSettings.PublicKey  = newKey.Value;

            LunaXmlSerializer.WriteXml(defaultSettings, SettingsFilePath);
        }
Example #2
0
        private static void CreateDefaultSettingsFile()
        {
            var defaultSettings = new SettingStructure();

            var newKey = GenerateNewKeypair();

            defaultSettings.PrivateKey = newKey.Key;
            defaultSettings.PublicKey  = newKey.Value;

            SaveSettingsToFile(defaultSettings);
        }
Example #3
0
 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.");
     }
 }
Example #4
0
 public static void SaveSettings(SettingStructure currentSettings)
 {
     CheckDataDirectory();
     LunaXmlSerializer.WriteXml(currentSettings, SettingsFilePath);
     File.Copy(SettingsFilePath, BackupSettingsFilePath, true);
 }
Example #5
0
 public static void SaveSettings(SettingStructure currentSettings)
 {
     CheckDataDirectory();
     SaveSettingsToFile(currentSettings);
     File.Copy(SettingsFilePath, BackupSettingsFilePath, true);
 }
Example #6
0
        private static void CreateDefaultSettingsFile()
        {
            var defaultSettings = new SettingStructure();

            LunaXmlSerializer.WriteToXmlFile(defaultSettings, SettingsFilePath);
        }