コード例 #1
0
        private void UpdateControl(Control ctrl)
        {
            if (ctrl == null)
            {
                return;
            }

            IMetroControl metroControl = ctrl as IMetroControl;

            if (metroControl != null)
            {
                ApplyTheme(metroControl);
            }

            IMetroComponent metroComponent = ctrl as IMetroComponent;

            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();
        }
コード例 #2
0
        private void UpdateControl(Control ctrl)
        {
            if (ctrl == null)
            {
                return;
            }
            IMetroControl metroControl = ctrl as IMetroControl;

            if (metroControl != null)
            {
                this.ApplyTheme(metroControl);
            }
            IMetroComponent metroComponent = ctrl as IMetroComponent;

            if (metroComponent != null)
            {
                this.ApplyTheme(metroComponent);
            }
            if (ctrl is TabControl)
            {
                foreach (TabPage tabPage in ((TabControl)ctrl).TabPages)
                {
                    this.UpdateControl(tabPage);
                }
            }
            if (ctrl.Controls != null)
            {
                foreach (Control control in ctrl.Controls)
                {
                    this.UpdateControl(control);
                }
            }
            if (ctrl.ContextMenuStrip != null)
            {
                this.UpdateControl(ctrl.ContextMenuStrip);
            }
            ctrl.Refresh();
        }
コード例 #3
0
 private void ApplyTheme(IMetroComponent component)
 {
     component.StyleManager = this;
 }
コード例 #4
0
 private void ApplyTheme(IMetroComponent component)
 {
     component.StyleManager = this;
 }
コード例 #5
0
 private void ApplyTheme(IMetroComponent component)
 {
     component.VisualManager = this;
 }