public AppAppearanceOptionControl() { this.InitializeComponent(); this.chkUseVisualStyles.Enabled = VisualStyleInformation.IsEnabledByUser; this.chkExplorerTheme.Enabled = ListViewEx.IsExplorerThemeSupported; this.ThemeList = new List<ThemeConfigurationSection>(Theme.GetAllThemes()); if (this.ThemeList.Count == 0) { this.cmbThemeFamily.Enabled = false; this.lblThemeFamily.Enabled = this.cmbThemeFamily.Enabled; } else { foreach (ThemeConfigurationSection section in this.ThemeList) { if (section.IsDefault) { this.DefaultTheme = section; } if (section.ThemeColorName == null) { this.cmbThemeFamily.Items.Add(section); } else if (this.cmbThemeFamily.Items.IndexOf(section.ThemeFamilyName) < 0) { this.cmbThemeFamily.Items.Add(section.ThemeFamilyName); } } } List<CultureInfo> list = new List<CultureInfo>(SettingsManager.GetInstalledCultures()); list.Sort(delegate (CultureInfo x, CultureInfo y) { return string.Compare(x.DisplayName, y.DisplayName, StringComparison.InvariantCultureIgnoreCase); }); this.cmbLanguage.DataSource = list; IniFormStringLocalizer argument = SettingsManager.GetArgument<IniFormStringLocalizer>(ArgumentKey.FormLocalizer); if (argument != null) { this.lblLanguageFile.Text = Path.GetFileName(argument.IniPath); this.lblLanguageFile.Visible = true; this.cmbLanguage.Enabled = false; } }
public static ThemeConfigurationSection Load(string fileName) { ThemeConfigurationSection section2; try { using (XmlReader reader = XmlReader.Create(fileName)) { reader.MoveToContent(); ThemeConfigurationSection section = new ThemeConfigurationSection(); section.DeserializeElement(reader, false); section._ThemeKey = Path.GetFileName(fileName); section2 = section; } } catch { section2 = null; } return section2; }