示例#1
0
 protected void Printed(PrinterEventArgs e)
 {
     if (OnPrinted != null)
     {
         OnPrinted(this, e);
     }
 }
 public void Log(object sender, PrinterEventArgs args)
 {
     using (StreamWriter writer = new StreamWriter("log.txt", true, Encoding.UTF8))
     {
         writer.WriteLine($"LOG {DateTime.Now}: {args.Message}");
     }
 }
示例#3
0
        internal override BaseResult DoService()
        {
            IPrint print = FPPrint.Create(_args.FPZL, _args.FPDM, _args.FPHM, true);

            print.Print();
            PrinterEventArgs printeventargs = new PrinterEventArgs()
            {
                Left = -10, Top = 0, IsQuanDa = true, PageLenght = 0, PrinterName = _args.Printer
            };

            print.printSetUp_0.printer_0.SaveUserPrinterEdge(printeventargs);

            PrintSetUp.pageSetupDialog.Document.PrinterSettings             = new PrinterSettings();
            PrintSetUp.pageSetupDialog.Document.PrinterSettings.PrinterName = _args.Printer;
            print.printSetUp_0.CurrentPrinterName = _args.Printer;
            PrintSetUp.pageSetupDialog.Document.PrinterSettings.DefaultPageSettings.PaperSize = print.printSetUp_0.paperSize_0;
            //byte[] imgbyte = print.DaYinMethod(print.printSetUp_0, new PrintSetEventArgs(), false);
            ;
            byte[] imgbyte1 = print.PreviewMethod();
            return(new DaYinResult(_args, Convert.ToBase64String(imgbyte1)));
        }
 private void manager_PrintSuccess(object sender, PrinterEventArgs e)
 {
     EnableAbortRetry(true);
     PrintButtonEnable(false);
     UpdateStatusbar("Printing card completed successfully");
     UpdateProgress("Printed OK");
 }
 private void manager_PrintFail(object sender, PrinterEventArgs e)
 {
     UpdateStatusbar("Printing card FAILED " + e.Status);
     EnableAbortRetry(true);
     PrintButtonEnable(false);
 }
 private void manager_Unregistered(object sender, PrinterEventArgs e)
 {
     UpdateStatusbar("Printer Unregistered");
     managerRegistered = false;
     ToggleConnected(false);
 }
 private void manager_RFIDReadTimeout(object sender, PrinterEventArgs e)
 {
     UpdateStatusbar("RFID Reading Error (card must be presented within " + Properties.Settings.Default.RFIDTimeout + " seconds)");
     PrintButtonEnable(false);
     EnableAbortRetry(true);
 }
 private void manager_RFIDRead(object sender, PrinterEventArgs e)
 {
     UpdateProgress("Place card on RFID Reader");
     EnableAbortRetry(true);
     PrintButtonEnable(false);
     UpdateStatusbar("Reading RFID");
 }
        private void manager_CardReady(object sender, PrinterEventArgs e)
        {
            UpdateCardDetails(e.Card);
            UpdateStatusbar("New card ready to print: " + e.Card.member_id);
            EnableAbortRetry(true); // abort skips to the next card
            UpdateProgress("Ready to print");

            if (cbUnattended.Checked)
            {
                UpdateStatusbar("Printing automatically (unattended mode)");
                PrintButtonEnable(false);
                manager.RequestPrint();
            } else {
                PrintButtonEnable(true);
            }
        }
 private void manager_CardLoadSuccess(object sender, PrinterEventArgs e)
 {
     UpdateStatusbar("Successfully loaded card");
     UpdateProgress("Card loaded");
     EnableAbortRetry(true);
     PrintButtonEnable(false);
 }
 private void manager_CardLoadFailed(object sender, PrinterEventArgs e)
 {
     UpdateStatusbar("Loading card FAILED - " + e.Status);
     PrintButtonEnable(false);
     EnableAbortRetry(true);
 }
 private void manager_CardLoad(object sender, PrinterEventArgs e)
 {
     UpdateStatusbar("Loading card into mechanism");
     UpdateProgress("Loading card...");
     PrintButtonEnable(false);
     EnableAbortRetry(true);
 }
示例#13
0
 private void OnPrinted(object sender, PrinterEventArgs e)
 {
     PrinterStatus           = e.Message;
     PrintProgressVisibility = Visibility.Collapsed;
 }
示例#14
0
 private void OnPrinting(object sender, PrinterEventArgs e)
 {
     PrinterStatus           = e.Message;
     PrintProgressVisibility = Visibility.Visible;
 }
 private void manager_Registered(object sender, PrinterEventArgs e)
 {
     UpdateStatusbar("Printer Registered");
     managerRegistered = true;
     ToggleConnected(true);
 }
 private void manager_RegisterError(object sender, PrinterEventArgs e)
 {
     UpdateStatusbar("Error registering printer: " + e.Status);
     managerRegistered = false;
     ToggleConnected(false);
 }
 private void manager_CardRequest(object sender, PrinterEventArgs e)
 {
     ResetCardForm();
     ResetProgress();
     EnableAbortRetry(false);
     PrintButtonEnable(false);
     //UpdateStatusbar("Requesting new cards...");
 }
 private void manager_RFIDReadSuccess(object sender, PrinterEventArgs e)
 {
     EnableAbortRetry(false);
     PrintButtonEnable(false);
     UpdateProgress("RFID Read OK (please remove)");
     UpdateStatusbar("RFID Read successfully: " + e.Status + " (please remove card from the reader)");
 }
 private void manager_MagEncode(object sender, PrinterEventArgs e)
 {
     EnableAbortRetry(true);
     PrintButtonEnable(false);
     UpdateStatusbar("Encoding card magnetic strip");
 }
 private void manager_RFIDRemoved(object sender, PrinterEventArgs e)
 {
     EnableAbortRetry(false);
     UpdateProgress("RFID Removed");
     UpdateStatusbar("Card removed from RFID Reader");
 }
 private void manager_MagEncodeFailed(object sender, PrinterEventArgs e)
 {
     EnableAbortRetry(true);
     PrintButtonEnable(false);
     UpdateStatusbar("Magnetic strip encoding FAILED " + e.Status);
 }
 private void manager_UpdateInfo(object sender, PrinterEventArgs e)
 {
     PrinterInfo info = e.Info;
     _lastInfo = info;
     UpdateInfo(info);
 }
 private void manager_MagEncodeSuccess(object sender, PrinterEventArgs e)
 {
     EnableAbortRetry(true);
     PrintButtonEnable(false);
     UpdateStatusbar("Magnetic strip encoding completed successfully");
     UpdateProgress("Encoded mag strip");
 }
示例#24
0
 public void Log(object sender, PrinterEventArgs args)
 {
     Console.WriteLine($"LOG {DateTime.Now}: {args.Message}");
 }
 private void manager_Print(object sender, PrinterEventArgs e)
 {
     UpdateProgress("Printing...");
     UpdateStatusbar("Printing card");
     EnableAbortRetry(true);
     PrintButtonEnable(false);
 }