ComponentFactory.Krypton.Ribbon.ViewDrawRibbonGroupComboBox.OnComboBoxPropertyChanged C# (CSharp) Method

OnComboBoxPropertyChanged() private method

private OnComboBoxPropertyChanged ( object sender, PropertyChangedEventArgs e ) : void
sender object
e System.ComponentModel.PropertyChangedEventArgs
return void
        private void OnComboBoxPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            bool updateLayout = false;
            bool updatePaint = false;

            switch (e.PropertyName)
            {
                case "Enabled":
                    UpdateEnabled(LastComboBox);
                    break;
                case "Visible":
                    UpdateVisible(LastComboBox);
                    updateLayout = true;
                    break;
                case "CustomControl":
                    updateLayout = true;
                    break;
            }

            if (updateLayout)
            {
                // If we are on the currently selected tab then...
                if ((_ribbonComboBox.RibbonTab != null) &&
                    (_ribbon.SelectedTab == _ribbonComboBox.RibbonTab))
                {
                    // ...layout so the visible change is made
                    OnNeedPaint(true);
                }
            }

            if (updatePaint)
            {
                // If this button is actually defined as visible...
                if (_ribbonComboBox.Visible || _ribbon.InDesignMode)
                {
                    // ...and on the currently selected tab then...
                    if ((_ribbonComboBox.RibbonTab != null) &&
                        (_ribbon.SelectedTab == _ribbonComboBox.RibbonTab))
                    {
                        // ...repaint it right now
                        OnNeedPaint(false, ClientRectangle);
                    }
                }
            }
        }