XSDDiagram.Rendering.DiagramPrinter.PrintPreview C# (CSharp) Метод

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

This creates and displays the print-preview dialog to both preview and print the diagram.
The dialog is displayed in the modal state.
public PrintPreview ( ) : void
Результат void
        public void PrintPreview()
        {
            if (_diagram == null)
            {
                throw new InvalidOperationException("There is no diagram to print");
            }

            PrintPreviewDialog previewDlg = new PrintPreviewDialog();

            Rectangle bounds = Screen.PrimaryScreen.Bounds;

            previewDlg.Width = (int)(bounds.Width * 2f / 3f);
            previewDlg.Height = (int)(bounds.Height * 2f / 3f);
            previewDlg.StartPosition = FormStartPosition.CenterParent;
            previewDlg.UseAntiAlias = true;
            previewDlg.Document = _printDocument;

            previewDlg.ShowDialog(Form.ActiveForm);
        }