ComponentFactory.Krypton.Ribbon.ViewDrawRibbonGroupRichTextBox.OnRichTextBoxPropertyChanged C# (CSharp) Method

OnRichTextBoxPropertyChanged() private method

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

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

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

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