public void Scan() { if (Scanned != null) { Scanned.Invoke(this, new ScannedDataEventArgs(new[] { "NO_BARCODE_SCANNER" })); } }
internal ScannedEvent InvokeEvent(ScannedEvent arg) { if (_api.ValidateEvent(arg)) { Scanned?.Invoke(_api, arg); } return(arg); }
/// <summary> /// Manually initiate the scan /// </summary> /// <remarks> /// The scanned barcode will be received in the <see cref="ScannedDataEventArgs.Data"/> /// parameter when the <see cref="IBarcodeScanner.Scanned"/> event is fired /// </remarks> public void Scan() { if (Scanned != null) { Scanned.Invoke(this, new ScannedDataEventArgs(new[] { new BarcodeData { Text = "NO_BARCODE_SCANNER" } })); } }
private void OnBarcodeRead(object sender, BarcodeReadEventArgs bre) { scannedData[0] = bre.strDataBuffer; if (Scanned != null) { Scanned.Invoke(this, new ScannedDataEventArgs(scannedData)); } reader.ScannerOn = false; scannerStatus = ScannerStatus.Opened; }
private void HandleData(ReaderData reader) { List <string> list = new List <string>(); list.Add(reader.Text); if (Scanned != null) { Scanned.Invoke(this, new ScannedDataEventArgs(list.ToArray())); } scannerStatus = ScannerStatus.Opened; }
private void HandleData(ReaderData data) { if (Scanned != null) { var barcodeData = new BarcodeData { Text = data.Text, BarcodeType = (BarcodeTypes)data.Type }; Scanned.Invoke(this, new ScannedDataEventArgs(new[] { barcodeData })); } scannerStatus = ScannerStatus.Opened; }
private void GetScannerStatusWorker() { running = true; try { while (running) { SystemLibNet.Api.SysWaitForEvent(Handle, OBReadLibNet.Def.OBR_NAME_EVENT, 2000 /*timeout SystemLibNet.Def.INFINITE*/); //Wait event int size = 0, code = 0; byte number = 0, len = 0; var result = OBReadLibNet.Api.OBRGetStatus(ref size, ref number); CheckCasioResult(result); if (number > 0) { var buffer = new byte[size]; result = OBReadLibNet.Api.OBRGets(buffer, ref code, ref len); CheckCasioResult(result); result = OBReadLibNet.Api.OBRClearBuff(); CheckCasioResult(result); if (Scanned != null) { var barcode = Encoding.Default.GetString(buffer, 0, buffer.Length).Trim(); var barcodeData = new BarcodeData { Text = barcode }; Scanned.Invoke(this, new ScannedDataEventArgs(new[] { barcodeData })); } } } } catch (ThreadAbortException) { } finally { running = false; } }
private void OnScanned(IReadOnlyBuyer buyer, Product product, int remainingAmount) { Scanned?.Invoke(this, new CashboxScanEventArgs(buyer, this, product, remainingAmount)); }
private void OnScanned(string dir) { Scanned?.Invoke(this, new ScanEventArgs(dir)); }
internal void OnScanned(string result) { Scanned?.Invoke(result); }