public usrc_TangentaPrint() { InitializeComponent(); Printers = new Printer[NumberOfPrinters]; for (int i = 0; i < Printers.Length; i++) { Printers[i] = new Printer(i); } }
public void Init(Printer xPrinter) { m_Printer = xPrinter; lbl_PrinterName.Text = lngRPM.s_Printer.s; this.lbl_PrinterName_Value.Text = m_Printer.printer_settings.PrinterName; lbl_PaperName.Text = lngRPM.s_PaperName.s + ":"; if (m_Printer.page_settings != null) { this.lbl_PaperName_Value.Text = m_Printer.page_settings.PaperSize.PaperName; PaperName = m_Printer.page_settings.PaperSize.PaperName; } else { this.lbl_PaperName_Value.Text = "??"; PaperName = "??"; } chk_PrintAll.Text = lngRPM.s_chk_PrintAll.s; this.chk_PrintAll.CheckedChanged -= new System.EventHandler(this.chk_PrintAll_CheckedChanged); chk_PrintAll.Checked = Properties.Settings.Default.Printer1_PrintAtOnce; m_Printer.PrintInBuffer = chk_PrintAll.Checked; this.chk_PrintAll.CheckedChanged += new System.EventHandler(this.chk_PrintAll_CheckedChanged); }
internal void Init(Printer printer) { m_Printer = printer; this.m_usrc_Device.Init(m_Printer); lngRPM.s_Printer.Text(grp_Printer, " " + (m_Printer.Index + 1).ToString()); if (m_Printer.Index == 0) { m_Printer.bPrinting_Invoices = Properties.Settings.Default.Printer1_Printing_Invoices; chk_Printing_Invoices.Checked = m_Printer.bPrinting_Invoices; m_Printer.bPrinting_ProformaInvoices = Properties.Settings.Default.Printer1_Printing_ProformaInvoices; chk_Printing_ProformaInvoices.Checked = m_Printer.bPrinting_ProformaInvoices; m_Printer.bPrinting_Reports = Properties.Settings.Default.Printer1_Printing_Reports; chk_Printing_Reports.Checked = m_Printer.bPrinting_Reports; } else { m_Printer.bPrinting_Invoices = Properties.Settings.Default.Printer2_Printing_Invoices; chk_Printing_Invoices.Checked = m_Printer.bPrinting_Invoices; m_Printer.bPrinting_ProformaInvoices = Properties.Settings.Default.Printer2_Printing_ProformaInvoices; chk_Printing_ProformaInvoices.Checked = m_Printer.bPrinting_ProformaInvoices; m_Printer.bPrinting_Reports = Properties.Settings.Default.Printer2_Printing_Reports; chk_Printing_Reports.Checked = m_Printer.bPrinting_Reports; } }
internal void Init(Printer printer) { m_Printer = printer; }
private bool SelectPrinter(InvoiceData m_InvoiceData, ref Printer selected_printer) { selected_printer = null; List<Printer> PrinterList = new List<Printer>(); if (IsDocProformaInvoice) { foreach (Printer printer in Printers) { if (printer.PrinterName != null) { if ((printer.PrinterName.Length > 0) && (!printer.PrinterName.Contains("?"))) { if (printer.bPrinting_ProformaInvoices) { PrinterList.Add(printer); } } } } if (PrinterList.Count == 1) { PrinterList[0].Init(m_InvoiceData); } else if (PrinterList.Count > 1) { //Select Printer from predefined_printers Form_SelectPrinter_from_predefined_printer_list printer_list_dlg = new Form_SelectPrinter_from_predefined_printer_list(PrinterList); printer_list_dlg.ShowDialog(this); selected_printer = printer_list_dlg.selected_printer; } if (selected_printer!=null) { selected_printer.Init(m_InvoiceData); return true; } else { //Select Printer from PrintDialog as usual } } return false; }
private void btn_OK_Click(object sender, EventArgs e) { selected_printer = (Printer) cmb_PrinterList.SelectedValue; DialogResult = DialogResult.OK; Close(); }