ComponentFactory.Krypton.Ribbon.ViewLayoutRibbonQATMini.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)
        {
            Debug.Assert(context != null);

            bool visibleQATButtons = false;

            // Scan to see if there are any visible quick access toolbar buttons
            foreach(IQuickAccessToolbarButton qatButton in _ribbon.QATButtons)
                if (qatButton.GetVisible())
                {
                    visibleQATButtons = true;
                    break;
                }

            // Only show the border if there are some visible contents
            _border.Visible = visibleQATButtons;

            // If there are no visible buttons, then extra button must be for customization
            if (!visibleQATButtons)
                _extraButton.Overflow = false;

            return base.GetPreferredSize(context);
        }