ComponentFactory.Krypton.Ribbon.ViewDrawRibbonGroupGallery.Layout C# (CSharp) Method

Layout() public method

Perform a layout of the elements.
public Layout ( ViewLayoutContext context ) : void
context ViewLayoutContext Layout context.
return void
        public override void Layout(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // We take on all the available display area
            ClientRectangle = context.DisplayRectangle;

            // Are we allowed to change the layout of controls?
            if (!context.ViewManager.DoNotLayoutControls)
            {
                // If we have an actual control, position it with a pixel padding all around
                if (LastGallery != null)
                {
                    LastGallery.SetBounds(ClientLocation.X + 1,
                                          ClientLocation.Y + 1,
                                          ClientWidth - 2,
                                          ClientHeight - 2);
                }
            }

            // Let child elements layout in given space
            base.Layout(context);
        }