C# Класс PrintSample.DisablePreviewPrintHelper

This class customizes the standard PrintHelper in order to disable print preview.
The PrintTaskRequestedMethod sets printTask.IsPreviewEnabled to false in order to disable print preview. Since print preview is disabled, the Paginate event will not be raised. Instead, the pages to be printed are generated in response to the AddPages event.
Наследование: PrintSample.PrintHelper
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
DisablePreviewPrintHelper ( PrintSample.Page scenarioPage ) : SDKTemplate

Защищенные методы

Метод Описание
AddOnePrintPage ( RichTextBlockOverflow lastRTBOAdded, PrintPageDescription printPageDescription ) : RichTextBlockOverflow

This function creates and adds one print page to the internal cache of print pages pages stored in printPages.

AddPrintPages ( object sender, AddPagesEventArgs e ) : void

This is the event handler for PrintDocument.AddPages. It provides all pages to be printed, in the form of UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements into a pages that the Windows print system can deal with.

PrintTaskRequested ( PrintManager sender, PrintTaskRequestedEventArgs e ) : void

This is the event handler for PrintManager.PrintTaskRequested. In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs.Request.Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.

Описание методов

AddOnePrintPage() защищенный Метод

This function creates and adds one print page to the internal cache of print pages pages stored in printPages.
protected AddOnePrintPage ( RichTextBlockOverflow lastRTBOAdded, PrintPageDescription printPageDescription ) : RichTextBlockOverflow
lastRTBOAdded RichTextBlockOverflow Last RichTextBlockOverflow element added in the current content
printPageDescription PrintPageDescription Printer's page description
Результат RichTextBlockOverflow

AddPrintPages() защищенный Метод

This is the event handler for PrintDocument.AddPages. It provides all pages to be printed, in the form of UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements into a pages that the Windows print system can deal with.
protected AddPrintPages ( object sender, AddPagesEventArgs e ) : void
sender object PrintDocument
e AddPagesEventArgs Add page event arguments containing a print task options reference
Результат void

DisablePreviewPrintHelper() публичный Метод

public DisablePreviewPrintHelper ( PrintSample.Page scenarioPage ) : SDKTemplate
scenarioPage PrintSample.Page
Результат SDKTemplate

PrintTaskRequested() защищенный Метод

This is the event handler for PrintManager.PrintTaskRequested. In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs.Request.Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.
protected PrintTaskRequested ( PrintManager sender, PrintTaskRequestedEventArgs e ) : void
sender PrintManager PrintManager
e PrintTaskRequestedEventArgs PrintTaskRequestedEventArgs
Результат void