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

ViewDrawRibbonGroupLabel() public method

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

            // Remember incoming references
            _ribbon = ribbon;
            _ribbonLabel = ribbonLabel;
            _needPaint = needPaint;

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

            // Give paint delegate to label so its palette changes are redrawn
            _ribbonLabel.ViewPaintDelegate = needPaint;

            // Create the different views for different sizes of the label
            CreateLargeLabelView();
            CreateMediumSmallLabelView();

            // Update all views to reflect current label state
            UpdateEnabledState();
            UpdateImageSmallState();
            UpdateItemSizeState();

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