private void UpdateSelectedItem() { if (listView1.SelectedItems.Count == 0) { applyButton.Enabled = false; return; } selectedIndex = listView1.SelectedIndices[0]; bool themeDownloaded = true; string previewHtml = null; if (selectedIndex > 0) { string themeId = (string)listView1.Items[selectedIndex].Tag; selectedIndex = ThemeManager.themeSettings.FindIndex(t => t.themeId == themeId) + 1; ThemeConfig theme = ThemeManager.themeSettings[selectedIndex - 1]; themeDownloaded = ThemeManager.IsThemeDownloaded(theme); previewHtml = ThemePreviewer.GeneratePreviewHtml(theme); } else { previewHtml = ThemePreviewer.GeneratePreviewHtml(null); } downloadButton.Enabled = !themeDownloaded; applyButton.Enabled = true; chromiumWebBrowser1.LoadHtml(previewHtml, "file://"); }
private void previewLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { ThemeConfig theme = ThemeManager.themeSettings[selectedIndex - 1]; ThemePreviewer.LaunchPreview(theme, previewImage); }