public void Load() { if (!File.Exists(SettingsPath)) { LunaXmlSerializer.WriteXml(new SettingsDefinition(), SettingsPath); } SettingsHolder = LunaXmlSerializer.ReadXml <SettingsDefinition>(SettingsPath); }
public void Load() { if (!File.Exists(SettingsPath)) { LunaXmlSerializer.WriteXml(Activator.CreateInstance(SettingsHolderType), SettingsPath); } SettingsHolder = LunaXmlSerializer.ReadXml(SettingsHolderType, SettingsPath); }
public static void SaveGroups() { lock (FileLock) { if (FileHandler.FolderExists(GroupsDirectory)) { LunaXmlSerializer.WriteXml(Groups.Values.ToList(), GroupsFilePath); } } }
private static void CreateDefaultSettingsFile() { var defaultSettings = new SettingStructure(); var newKey = GenerateNewKeypair(); defaultSettings.PrivateKey = newKey.Key; defaultSettings.PublicKey = newKey.Value; LunaXmlSerializer.WriteXml(defaultSettings, SettingsFilePath); }
public static void SaveSettings(SettingStructure currentSettings) { CheckDataDirectory(); LunaXmlSerializer.WriteXml(currentSettings, SettingsFilePath); File.Copy(SettingsFilePath, BackupSettingsFilePath, true); }
public void Save() { LunaXmlSerializer.WriteXml(SettingsHolder, SettingsPath); }