コード例 #1
0
        public void Load()
        {
            if (!File.Exists(SettingsPath))
            {
                LunaXmlSerializer.WriteXml(new SettingsDefinition(), SettingsPath);
            }

            SettingsHolder = LunaXmlSerializer.ReadXml <SettingsDefinition>(SettingsPath);
        }
コード例 #2
0
        public void Load()
        {
            if (!File.Exists(SettingsPath))
            {
                LunaXmlSerializer.WriteXml(Activator.CreateInstance(SettingsHolderType), SettingsPath);
            }

            SettingsHolder = LunaXmlSerializer.ReadXml(SettingsHolderType, SettingsPath);
        }
コード例 #3
0
 public static void SaveGroups()
 {
     lock (FileLock)
     {
         if (FileHandler.FolderExists(GroupsDirectory))
         {
             LunaXmlSerializer.WriteXml(Groups.Values.ToList(), GroupsFilePath);
         }
     }
 }
コード例 #4
0
        private static void CreateDefaultSettingsFile()
        {
            var defaultSettings = new SettingStructure();

            var newKey = GenerateNewKeypair();

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

            LunaXmlSerializer.WriteXml(defaultSettings, SettingsFilePath);
        }
コード例 #5
0
 public static void SaveSettings(SettingStructure currentSettings)
 {
     CheckDataDirectory();
     LunaXmlSerializer.WriteXml(currentSettings, SettingsFilePath);
     File.Copy(SettingsFilePath, BackupSettingsFilePath, true);
 }
コード例 #6
0
 public void Save()
 {
     LunaXmlSerializer.WriteXml(SettingsHolder, SettingsPath);
 }