private void UpdateControl(Control ctrl) { if (ctrl == null) { return; } IWellsMetroControl metroControl = ctrl as IWellsMetroControl; if (metroControl != null) { ApplyTheme(metroControl); } IWellsMetroComponent metroComponent = ctrl as IWellsMetroComponent; if (metroComponent != null) { ApplyTheme(metroComponent); } TabControl tabControl = ctrl as TabControl; if (tabControl != null) { foreach (TabPage tp in ((TabControl)ctrl).TabPages) { UpdateControl(tp); } } if (ctrl.Controls != null) { foreach (Control child in ctrl.Controls) { UpdateControl(child); } } if (ctrl.ContextMenuStrip != null) { UpdateControl(ctrl.ContextMenuStrip); } ctrl.Refresh(); }
private void ApplyTheme(IWellsMetroControl control) { control.StyleManager = this; }