private static FormThemeEditorController CreateEditorController() { var editor = new FormThemeEditorController(ThemeManager, Persistence); AppSettings.Saved += editor.SaveCurrentTheme; return(editor); }
public FormThemeEditor(FormThemeEditorController controller) : this() { _controller = controller; var sysColors = Theme.SysColors.OrderBy(c => c.ToString(), StringComparer.InvariantCulture); foreach (var name in sysColors) { _layoutPanel.Controls.Add( CreateColorPicker( name, (theme, n) => theme.GetColor(n), (theme, n) => theme.GetDefaultColor(n), (editor, n, color) => editor.SetColor(n, color), (editor, n) => editor.Reset(n))); } var appColors = Theme.AppColors.OrderBy(c => c.ToString(), StringComparer.InvariantCulture); foreach (var name in appColors) { _layoutPanel.Controls.Add( CreateColorPicker( name, (theme, n) => theme.GetColor(n), (theme, n) => theme.GetDefaultColor(n), (editor, n, color) => editor.SetColor(n, color), (editor, n) => editor.Reset(n))); } _layoutPanel.SetFlowBreak(_layoutPanel.Controls[_layoutPanel.Controls.Count - 1], true); AddButtons(); Closing += (s, e) => { Hide(); e.Cancel = true; }; UpdateFormSize(); InitializeComplete(); }
public ThemeDeployment(FormThemeEditorController editorController) { _editorController = editorController; }