Beispiel #1
0
        public void LoadUserPreferences()
        {
            String manticoreAppData = FileLocator.GetManticorePath("AppData");
            String prefPath         = FileLocator.GetManticorePath("UserPrefs");

            try {
                LoadPreferencesFile(prefPath);
            }
            catch (XmlException) {
                // Something went wrong, we'll just assume a malformed or non-existant
                // preferences file, blow it away and insert a new one. Could potentially
                // be dangerous.
                try {
                    File.Copy(@"defaults\user-prefs.xml", prefPath, true);
                }
                catch (DirectoryNotFoundException) {
                    Directory.CreateDirectory(manticoreAppData);
                    File.Copy(@"defaults\user-prefs.xml", prefPath, true);
                }
                LoadPreferencesFile(prefPath);
            }
        }
Beispiel #2
0
 public void FlushUserPreferences()
 {
     FlushPreferencesFile(FileLocator.GetManticorePath("UserPrefs"));
 }