ComponentFactory.Krypton.Ribbon.ViewDrawRibbonGroupButton.GetPreferredSize C# (CSharp) Method

GetPreferredSize() public method

Discover the preferred size of the element.
public GetPreferredSize ( ViewLayoutContext context ) : Size
context ComponentFactory.Krypton.Toolkit.ViewLayoutContext Layout context.
return System.Drawing.Size
        public override Size GetPreferredSize(ViewLayoutContext context)
        {
            bool drawNonTrackingAreas = (_ribbon.RibbonShape != PaletteRibbonShape.Office2010);

            // Update the views with the type of button being used
            _viewLarge.ButtonType = _ribbonButton.ButtonType;
            _viewLarge.DrawNonTrackingAreas = drawNonTrackingAreas;
            _viewMediumSmall.ButtonType = _ribbonButton.ButtonType;
            _viewMediumSmall.DrawNonTrackingAreas = drawNonTrackingAreas;

            // Get the preferred size of button view
            Size preferredSize = base.GetPreferredSize(context);

            if (_currentSize == GroupItemSize.Large)
                preferredSize.Height = _ribbon.CalculatedValues.GroupTripleHeight;
            else
                preferredSize.Height = _ribbon.CalculatedValues.GroupLineHeight;

            return preferredSize;
        }