ComponentFactory.Krypton.Toolkit.ViewDrawContent.GetPreferredSize C# (CSharp) Method

GetPreferredSize() public method

Discover the preferred size of the element.
public GetPreferredSize ( ViewLayoutContext context ) : Size
context ViewLayoutContext Layout context.
return System.Drawing.Size
        public override Size GetPreferredSize(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // Validate incoming reference
            if (context == null) throw new ArgumentNullException("context");

            // By default we take up no space at all
            Size preferredSize = Size.Empty;

            // If we have some content to encompass
            if (_paletteContent.GetContentDraw(State) == InheritBool.True)
            {
                // Ask the renderer for the contents preferred size
                preferredSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context,
                                                                                               _paletteContent,
                                                                                               _values,
                                                                                               Orientation,
                                                                                               State,
                                                                                               DrawContentOnComposition);
            }

            return preferredSize;
        }