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

GetPreferredSize() public method

Get the preferred size of the control based on a proposed size.
public GetPreferredSize ( Size proposedSize ) : Size
proposedSize System.Drawing.Size Starting size proposed by the caller.
return System.Drawing.Size
        public override Size GetPreferredSize(Size proposedSize)
        {
            // Let base class continue with standard calculations
            proposedSize = base.GetPreferredSize(proposedSize);

            // Do we need to apply the border width?
            if (AutoSize)
            {
                if (Orientation == Orientation.Horizontal)
                    proposedSize.Height = _stateCurrent.GetBorderWidth(_state);
                else
                    proposedSize.Width = _stateCurrent.GetBorderWidth(_state);
            }

            return proposedSize;
        }