ComponentFactory.Krypton.Toolkit.PaletteBorder.GetBorderWidth C# (CSharp) Method

GetBorderWidth() public method

Gets the border width.
public GetBorderWidth ( PaletteState state ) : int
state PaletteState Palette value should be applicable to this state.
return int
        public int GetBorderWidth(PaletteState state)
        {
            if (Width != -1)
                return Width;
            else
                return _inherit.GetBorderWidth(state);
        }

Usage Example

        /// <summary>
        /// Discover the preferred size of the element.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override Size GetPreferredSize(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // Start with size needed to draw a week number
            Size retSize = new Size(_months.SizeDay.Width, _months.SizeDays.Height);

            // Add the width of the vertical border
            retSize.Width += _palette.GetBorderWidth(State);

            return(retSize);
        }