private void AddBackground(PageContent pageContent, bool isLastpage)
        {
            if (!_printProcessor.PrintDefinition.IsToPrint(PrintAppendixes.Background, CurrentPageNumber, isLastpage))
            {
                return;
            }

            var backgound = _printProcessor.GetBackgound();

            if (backgound == null)
            {
                throw new InvalidOperationException("The Background cannot be null if the corresponding flag in the PrintAppendix is set");
            }

            var positioningPoint = new Point(backgound.Size.Left, backgound.Size.Top);

            Debug.WriteLine($"PRINTING: Print background on page #{CurrentPageNumber} ");
            PositionizeUiElement(pageContent, backgound.Element, positioningPoint);
        }
Esempio n. 2
0
        private void AddBackground(PageContent pageContent, bool isLastpage)
        {
            if (!_printProcessor.PrintDefinition.IsToPrint(PrintAppendixes.Background, CurrentPageNumber, isLastpage))
            {
                return;
            }

            var backgound = _printProcessor.GetBackgound();

            if (backgound == null)
            {
                throw new InvalidOperationException($"The instance of type \"{_printProcessor.GetType()}\" must return a value for \"{nameof(PrintProcessor.GetBackgound)}()\" if \"{PrintAppendixes.Background}\" is set.");
            }

            var positioningPoint = new Point(backgound.Size.Left, backgound.Size.Top);

            Debug.WriteLine($"PRINTING: Print background on page #{CurrentPageNumber} ");
            PositionizeUiElement(pageContent, backgound.Element, positioningPoint);
        }