ComponentFactory.Krypton.Ribbon.ViewDrawRibbonGroupColorButton.ViewDrawRibbonGroupColorButton C# (CSharp) Method

ViewDrawRibbonGroupColorButton() public method

Initialize a new instance of the ViewDrawRibbonGroupColorButton class.
public ViewDrawRibbonGroupColorButton ( KryptonRibbon ribbon, KryptonRibbonGroupColorButton ribbonColorButton, NeedPaintHandler needPaint ) : System
ribbon KryptonRibbon Reference to owning ribbon control.
ribbonColorButton KryptonRibbonGroupColorButton Reference to source color button definition.
needPaint NeedPaintHandler Delegate for notifying paint requests.
return System
        public ViewDrawRibbonGroupColorButton(KryptonRibbon ribbon,
                                              KryptonRibbonGroupColorButton ribbonColorButton,
                                              NeedPaintHandler needPaint)
        {
            Debug.Assert(ribbon != null);
            Debug.Assert(ribbonColorButton != null);
            Debug.Assert(needPaint != null);

            // Remember incoming references
            _ribbon = ribbon;
            _ribbonColorButton = ribbonColorButton;
            _needPaint = needPaint;
            _currentSize = _ribbonColorButton.ItemSizeCurrent;

            // Associate this view with the source component (required for design time selection)
            Component = _ribbonColorButton;

            // Create the different views for different sizes of the button
            CreateLargeButtonView();
            CreateMediumSmallButtonView();

            // Update all views to reflect current button state
            UpdateEnabledState();
            UpdateCheckedState();
            UpdateDropDownState();
            UpdateItemSizeState();

            // Hook into changes in the ribbon button definition
            _ribbonColorButton.PropertyChanged += new PropertyChangedEventHandler(OnButtonPropertyChanged);
        }