Esempio n. 1
0
 private void LoadPrinter()
 {
     this.txbDefaultPrinter.Text = printSetups.DefaultInfo.Printer;
     this.txbDefaultBin.Text = printSetups.DefaultInfo.BinName;
     this.default_binno = printSetups.DefaultInfo.BinNo;
     this.chbSizeWarning.Checked = printSetups.DefaultInfo.SizeWarning;
     this.prtInfoList = new List<PrinterInfoClass>();
     if (printSetups.PrinterInfoList.Count != 0)
     {
         foreach (PrinterInfoClass class4 in printSetups.PrinterInfoList)
         {
             PrinterInfoClass item = new PrinterInfoClass {
                 Name = class4.Name,
                 DoublePrint = class4.DoublePrint
             };
             foreach (BinClass class5 in class4.BinList)
             {
                 BinClass bin = new BinClass {
                     L = class5.L,
                     Name = class5.Name,
                     No = class5.No,
                     Orientation = class5.Orientation,
                     Size = class5.Size,
                     T = class5.T
                 };
                 item.BinList.Add(bin);
             }
             this.prtInfoList.Add(item);
         }
     }
     else
     {
         PrintDocument document = new PrintDocument();
         if (document.PrinterSettings.IsValid)
         {
             this.GetPrinterInfo(document.PrinterSettings);
         }
     }
     this.tbpPrinter_Refresh();
 }
Esempio n. 2
0
 private void GetPrinterInfo(PrinterSettings ps)
 {
     BinClass class3;
     PrinterInfoClass item = new PrinterInfoClass {
         Name = ps.PrinterName,
         DoublePrint = false,
         BinList = new BinListClass()
     };
     if (ps.PaperSources.Count > 0)
     {
         foreach (PaperSource source in ps.PaperSources)
         {
             class3 = new BinClass {
                 No = source.RawKind,
                 Name = source.SourceName
             };
             if (!this.IsErrorBinNo(item.BinList, class3.No))
             {
                 item.BinList.Add(class3);
             }
         }
     }
     else
     {
         PaperSource paperSource = ps.DefaultPageSettings.PaperSource;
         class3 = new BinClass {
             No = paperSource.RawKind,
             Name = paperSource.SourceName
         };
         item.BinList.Add(class3);
     }
     this.prtInfoList.Add(item);
 }