public static void Load() { foreach (var p in typeof(Settings).GetProperties()) { var value = SettingsFile.GetValue(SettingsSection, p.Name, ""); object convertedValue; if (p.PropertyType == typeof(LanguageFile)) { convertedValue = LanguageFile.LoadFromDefault(value); } else if (p.PropertyType == typeof(WindowBorderSkin)) { convertedValue = WindowBorderSkinProvider.LoadTheme(value.Split(',')[0], value.Split(',')[1]); } else if (p.PropertyType == typeof(ExplorerSkin)) { convertedValue = ExplorerSkin.LoadTheme(value.Split(',')[0], value.Split(',')[1]); } else { convertedValue = Convert.ChangeType(value, p.PropertyType); } p.SetValue(null, convertedValue, null); } PropertyChanged += AutoSave; }
private void LanguageList_SelectedIndexChanged(object sender, EventArgs args) { if (LanguageList.Text == Settings.Language.Name) { return; } Settings.Language = LanguageFile.LoadFromDefault(LanguageList.Text); ApplyLanguage(); ReBuildLangGroups(); }