示例#1
0
        public void SelectPrinter(string printerName)
        {
            try
            {
                if (this.availablePrinterNames.Contains(printerName) && !string.IsNullOrEmpty(printerName))
                {
                    this.selectedPrinterName = printerName;
                    OnPrinterChanged?.Invoke(this.selectedPrinterName);

                    var printLog = Language.I.Text("printer_selected", "Printer selected and this printer will be used when next start!");
                    SafeFireLoging(printLog);

                    WritPrinterName(printerName);
                }
                else
                {
                    SafeFireLoging(Language.I.Text("invalid_printer", "Printer was invalid!"));
                }
            }
            catch (Exception ex)
            {
                SafeFireLoging(Language.I.Text("invalid_printer", "Printer was invalid!"));
                HttpServer.Logger.Log(ex.ToString());
            }
        }
示例#2
0
        public void SelectPrinter(string printerName)
        {
            try
            {
                if (this.availablePrinterNames.Contains(printerName) && !string.IsNullOrEmpty(printerName))
                {
                    this.selectedPrinterName = printerName;
                    OnPrinterChanged?.Invoke(this.selectedPrinterName);

                    SafeFireLoging("打印机被选中" + printerName + " 已写入配置文件,下次启动将使用此打印机");

                    WritPrinterName(printerName);
                }
                else
                {
                    SafeFireLoging("无效打印机名称");
                }
            }
            catch (Exception ex)
            {
                SafeFireLoging("更新统计信息失败:" + ex.Message);
                HttpServer.Logger.Log(ex.ToString());
            }
        }
示例#3
0
 private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e)
 {
     // Add code to handle the SettingsSaving event here.
     PrinterChanged.Invoke();
 }