예제 #1
0
        private void FillPrinters()
        {
            var    installedPrinters = PrinterSettings.InstalledPrinters;
            var    printerSettings   = new PrinterSettings();
            string defaultPrinter    = printerSettings.PrinterName;

            cmbxPrinterNames.SelectedIndexChanged -= cmbxPrinterNames_SelectedIndexChanged;
            PdfPrintTest.FillComboBox(cmbxPrinterNames, installedPrinters, defaultPrinter);
            cmbxPrinterNames.SelectedIndexChanged += cmbxPrinterNames_SelectedIndexChanged;
        }
        public void ApplyPrinterInfo(PrinterInfo printerInfo)
        {
            cbDefaultPaperSize.Checked         = true;
            cbDefaultPaperSource.Checked       = true;
            cbDefaultPrinterResolution.Checked = true;
            cbDefaultPrintInColor.Checked      = true;
            cbDefaultPrintOrientation.Checked  = true;

            cbPrintInColor.Checked = printerInfo.Color;
            rbLandscape.Checked    = printerInfo.Landscape;
            rbPortrait.Checked     = !printerInfo.Landscape;
            _printerSettings       = null;

            rbLandscape.Checked = printerInfo.Landscape;
            rbPortrait.Checked  = !printerInfo.Landscape;

            PdfPrintTest.FillComboBox(cmbxPrinterResolutions, printerInfo.PrinterResolutions, printerInfo.PrinterResolution);
            PdfPrintTest.FillComboBox(cmbxPaperSize, printerInfo.PaperSizes, printerInfo.PaperSize);
            PdfPrintTest.FillComboBox(cmbxPaperSource, printerInfo.PaperSources, printerInfo.PaperSource);

            PrinterName = printerInfo.PrinterName;
            cbUsePrinterSettings.Checked = false;
            EnableOrDisableFieldsBasedOnDefaultCheck();
        }