Ejemplo n.º 1
0
        /// <summary>
        /// Shows the print dialog for the specified <paramref name="document"/>, printing after closed if the user selects to print.
        /// </summary>
        /// <returns>The result.</returns>
        /// <param name="parent">Parent of the dialog to make modal.</param>
        /// <param name="document">Document to print.</param>
        public DialogResult ShowDialog(Control parent, PrintDocument document)
        {
            document.OnBeforePrint();
            PrintSettings = document.PrintSettings;
            PrintSettings.MaximumPageRange = new Range <int>(1, document.PageCount);
            Handler.Document = document;
            var result = ShowDialog(parent);

            document.OnAfterPrint();
            return(result);
        }