コード例 #1
0
        private static FormThemeEditorController CreateEditorController()
        {
            var editor = new FormThemeEditorController(ThemeManager, Persistence);

            AppSettings.Saved += editor.SaveCurrentTheme;
            return(editor);
        }
コード例 #2
0
        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();
        }
コード例 #3
0
 public ThemeDeployment(FormThemeEditorController editorController)
 {
     _editorController = editorController;
 }