ComponentFactory.Krypton.Toolkit.ViewLayoutMonths.MaxGridCellDayOfWeek C# (CSharp) Method

MaxGridCellDayOfWeek() private method

private MaxGridCellDayOfWeek ( ViewLayoutContext context ) : Size
context ViewLayoutContext
return System.Drawing.Size
        private Size MaxGridCellDayOfWeek(ViewLayoutContext context)
        {
            _shortText = "A";

            // Find sizes required for the different
            Size shortNormalSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _calendar.StateNormal.DayOfWeek.Content, this, VisualOrientation.Top, PaletteState.Normal, false);
            Size shortDisabledSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _calendar.StateDisabled.DayOfWeek.Content, this, VisualOrientation.Top, PaletteState.Disabled, false);

            _shortText = "A" + _dayOfWeekMeasure;

            // Find sizes required for the different
            Size fullNormalSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _calendar.StateNormal.DayOfWeek.Content, this, VisualOrientation.Top,  PaletteState.Normal, false);
            Size fullDisabledSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context, _calendar.StateDisabled.DayOfWeek.Content, this, VisualOrientation.Top, PaletteState.Disabled, false);

            // Find largest size required (subtract a fudge factor of 3 pixels as Graphics.MeasureString is always too big)
            fullNormalSize.Width = Math.Max(fullNormalSize.Width - shortNormalSize.Width - 3, fullDisabledSize.Width - shortDisabledSize.Width - 3);
            fullNormalSize.Height = Math.Max(fullNormalSize.Height, fullDisabledSize.Height);

            return fullNormalSize;
        }