ComponentFactory.Krypton.Ribbon.ViewDrawRibbonGroupLabelText.MakeDirty C# (CSharp) Method

MakeDirty() public method

Make dirty so cached values are not used.
public MakeDirty ( ) : void
return void
        public void MakeDirty()
        {
            _dirtyPaletteSize = 0;
            _dirtyPaletteLayout = 0;
        }

Usage Example

Example #1
0
        private void OnLabelPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            bool updateLayout = false;
            bool updatePaint  = false;

            switch (e.PropertyName)
            {
            case "Visible":
                updateLayout = true;
                break;

            case "TextLine1":
                _viewLargeText1.MakeDirty();
                _viewMediumSmallText1.MakeDirty();
                updateLayout = true;
                break;

            case "TextLine2":
                _viewLargeText2.MakeDirty();
                _viewMediumSmallText2.MakeDirty();
                updateLayout = true;
                break;

            case "ImageSmall":
                UpdateImageSmallState();
                updateLayout = true;
                break;

            case "Enabled":
                UpdateEnabledState();
                updatePaint = true;
                break;

            case "ImageLarge":
                updatePaint = true;
                break;

            case "ItemSizeMinimum":
            case "ItemSizeMaximum":
            case "ItemSizeCurrent":
                UpdateItemSizeState();
                updateLayout = true;
                break;

            case "KryptonCommand":
                _viewLargeText1.MakeDirty();
                _viewLargeText2.MakeDirty();
                _viewMediumSmallText1.MakeDirty();
                _viewMediumSmallText2.MakeDirty();
                updateLayout = true;
                break;
            }

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

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