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

ViewDrawRibbonGroupRadioButton() public method

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

            // Remember incoming references
            _ribbon = ribbon;
            _ribbonRadioButton = ribbonRadioButton;
            _needPaint = needPaint;
            _currentSize = _ribbonRadioButton.ItemSizeCurrent;

            // Create delegate used to process end of click action
            _finishDelegateLarge = new EventHandler(ActionFinishedLarge);
            _finishDelegateMediumSmall = new EventHandler(ActionFinishedMediumSmall);

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

            // Create the different views for different sizes of the radio button
            CreateLargeRadioButtonView();
            CreateMediumSmallRadioButtonView();

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

            // Hook into changes in the ribbon radio button definition
            _ribbonRadioButton.PropertyChanged += new PropertyChangedEventHandler(OnRadioButtonPropertyChanged);
        }