Example #1
0
        private Int32 linesToAdd(TellerStyle style)
        {
            // ReSharper disable once SwitchStatementMissingSomeCases
            switch (style)
            {
            case TellerStyle.Division:
                return(4);

            case TellerStyle.First:
                return(3);

            default:
                return(0);
            }
        }
Example #2
0
        private void addPageBreak(Int32 position, Block block, TellerStyle style)
        {
            var fitsToPage       = currentLine == pageLines;
            var hasNoTellerSpace = linesToAdd(style) == 0;
            var hasNoBlockSpace  = position > 0;

            var shouldBeSamePage = fitsToPage &&
                                   hasNoTellerSpace && hasNoBlockSpace;

            var insertAt = position
                           + (shouldBeSamePage ? 1 : 0);

            currentLine -=
                shouldBeSamePage
                                ? pageLines
                                : oldLine;

            block.ParagraphTypeList.Insert(insertAt, ParagraphType.Page);
        }