Exemple #1
0
        private static void SetControlTheme(Control control, ColorTheme theme)
        {
            IThemedControl ctrl = control as IThemedControl;

            if (ctrl != null)
            {
                ctrl.SetTheme(theme);
            }

            foreach (Control child in control.Controls)
            {
                SetControlTheme(child, theme);
            }
        }
Exemple #2
0
        public static void ChangeTheme <T>(this Controls.Form form) where T : ColorTheme, new()
        {
            Type type = typeof(T);

            if (!themes.ContainsKey(type))
            {
                AddTheme(new T());
            }

            ColorTheme theme = themes[type];

            foreach (Control control in form.Controls)
            {
                SetControlTheme(control, theme);
            }

            form.SetTheme(theme);
            CurrentTheme = theme;
        }
 public ThemedToolStripRenderer(ColorTheme theme) : base(new ThemedColorTable(theme))
 {
 }
Exemple #4
0
 public static void AddTheme(ColorTheme theme)
 {
     themes.Add(theme.GetType(), theme);
 }
Exemple #5
0
 public ThemedColorTable(ColorTheme theme) : base()
 {
     this.theme = theme;
 }