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); } }
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)) { }
public static void AddTheme(ColorTheme theme) { themes.Add(theme.GetType(), theme); }
public ThemedColorTable(ColorTheme theme) : base() { this.theme = theme; }