XSDDiagram.Rendering.DiagramPrinter.Print C# (CSharp) Méthode

Print() public méthode

This prints the currently displayed diagram, with an option to display the print dialog, PrintDialog.
public Print ( bool showDialog, bool isRunningOnMono ) : void
showDialog bool /// This indicates whether to display the /// dialog or not. If , the print dialog is /// display to the user to prompt the print operation, and the user /// could cancel the print operation. ///
isRunningOnMono bool
Résultat void
        public void Print(bool showDialog, bool isRunningOnMono)
        {
            if (_diagram == null)
            {
                throw new InvalidOperationException("There is no diagram to print");
            }

            if (showDialog)
            {
                PrintDialog printDlg = new PrintDialog();
                printDlg.UseEXDialog = !isRunningOnMono;
                printDlg.Document = _printDocument;

                if (printDlg.ShowDialog(Form.ActiveForm) == DialogResult.OK)
                {
                    _printDocument.Print();
                }
            }
            else
            {
                _printDocument.Print();
            }
        }