diff --git a/RhythmBullet/Zer01HD/Utilities/Persistence/PreferencesManager.cs b/RhythmBullet/Zer01HD/Utilities/Persistence/PreferencesManager.cs index 3c1ffab..0d59932 100644 --- a/RhythmBullet/Zer01HD/Utilities/Persistence/PreferencesManager.cs +++ b/RhythmBullet/Zer01HD/Utilities/Persistence/PreferencesManager.cs @@ -37,11 +37,13 @@ namespace RhythmBullet.Zer01HD.Utilities.Persistence public void Load() { - foreach (KeyValuePair prefs in preferenceList) + List keys = new List(preferenceList.Keys); + + foreach (Type key in keys) { - if (!LoadSpecific(prefs.Key)) + if (!LoadSpecific(key)) { - SaveSpecific(prefs.Key); + SaveSpecific(key); } } } @@ -56,10 +58,10 @@ namespace RhythmBullet.Zer01HD.Utilities.Persistence private bool LoadSpecific(Type preference) { - string path = savePath + "/" + preference.Name; + string path = savePath + "/" + preference.Name + ".xml"; if (File.Exists(path)) { - Stream stream = new FileStream(savePath + "/" + preference.Name + ".xml", FileMode.Open); + Stream stream = new FileStream(path, FileMode.Open); preferenceList[preference] = (Preferences)xmlSerializer.Deserialize(stream); stream.Close(); return true;