ComponentFactory.Krypton.Toolkit.VisualContextMenu.CalculatePreferredSize C# (CSharp) Method

CalculatePreferredSize() private method

private CalculatePreferredSize ( ) : Size
return System.Drawing.Size
        private Size CalculatePreferredSize()
        {
            // Prevent calculation of layout from performing a recursive layout
            SuspendLayout();

            try
            {
                // Find the preferred size which fits exactly the calculated contents size
                using (ViewLayoutContext context = new ViewLayoutContext(this, Renderer))
                    return ViewManager.Root.GetPreferredSize(context);
            }
            finally
            {
                // Must always have matching suspend/resume
                ResumeLayout();
            }
        }