ComponentFactory.Krypton.Toolkit.ViewDrawMenuCheckButton.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);

            // Update text and image values
            _contentValues.ShortText = ResolveText;
            _contentValues.LongText = ResolveExtraText;
            _contentValues.Image = ResolveImage;
            _contentValues.ImageTransparentColor = ResolveImageTransparentColor;

            // Find new enabled state
            _itemEnabled = _provider.ProviderEnabled && ResolveEnabled;

            // Update with enabled state
            _drawButton.Enabled = _itemEnabled;

            // Update the checked state
            _drawButton.Checked = ResolveChecked;

            return base.GetPreferredSize(context);
        }