private void changeSelectedToolStripMenuItem_Click(object sender, EventArgs e) { if (lstViewTrays.SelectedItems.Count == 0) { MessageBox.Show(GetString("SELECTATRAYINTHELISTOFTRAYSFIRST")); return; } if (lstViewTrays.SelectedItems.Count > 1) { MessageBox.Show(GetString("SELECTONLYONETRAY")); return; } PrinterTrayItem t; t = (PrinterTrayItem)lstViewTrays.SelectedItems[0].Tag; PrinterTrayForm theForm; theForm = new PrinterTrayForm(); theForm.PrintGroup = this.PrintGroup; theForm.Printer = this.Printer; theForm.PrinterTray = t; theForm.ConnectionParameter = this.ConnectionParameter; if (theForm.ShowDialog() == DialogResult.OK) { t.CurrentPapertypeName = theForm.PrinterTray.CurrentPapertypeName; } RenderPrinter(); }
private void addTrayToolStripMenuItem_Click(object sender, EventArgs e) { PrinterTrayForm theForm; theForm = new PrinterTrayForm(); theForm.PrintGroup = this.PrintGroup; theForm.Printer = this.Printer; theForm.ConnectionParameter = this.ConnectionParameter; if (theForm.ShowDialog() == DialogResult.OK) { //Add the selected Tray and printer to the printeritem Printer.Trays.Add(theForm.PrinterTray); RenderPrinter(); } }
private void lstPrinters_Click(object sender, EventArgs e) { if (lstPrinters.SelectedItems.Count == 0) { MessageBox.Show(GetString("DOUBLECLICKONAPRINTER")); return; } PrinterFullData fi; fi = (PrinterFullData)lstPrinters.SelectedItems[0].Tag; PrinterTrayForm ptForm; ptForm = new PrinterTrayForm(); ptForm.ConnectionParameter = this.ConnectionParameters; ptForm.PrintGroup = fi.PrintGroup; ptForm.Printer = fi.Printer; ptForm.PrinterTray = fi.Tray; if (ptForm.ShowDialog() == DialogResult.OK) { fi.Tray.CurrentPapertypeName = ptForm.PrinterTray.CurrentPapertypeName; RemClientControlObjectProxy theObj; theObj = new RemClientControlObjectProxy(); theObj.ConParameter = conParm; try { StartRemote(); theObj.UpdatePrinterForPrintgroup(fi.PrintGroup, fi.Printer); } catch (RemClientControlObjectProxyException) { MessageBox.Show(GetString("CHANGESCOULDNOTBESTOREDBYPRINTERSERVICE")); } finally { StopRemote(); theObj.Dispose(); } LoadData(); RenderData(); } }