Ejemplo n.º 1
0
 private void _OnBarcodeFound(object sender, BarcodeFoundEventArgs e)
 {
     // e.cancel = (e.Count == 3);		// Cancel after 3 barcodes are found
     txtRslt.Text = txtRslt.Text + "_OnBarcodeFound -> ";
     string s = txtRslt.Text;
     AddBarcode(ref s, e.Count, e.Barcode);
     txtRslt.Text = s;
     System.Windows.Forms.Application.DoEvents();
 }
Ejemplo n.º 2
0
 private void _OnBarcodeFoundThread(object sender, BarcodeFoundEventArgs e)
 {
     lock (_lockObject)
     {
         string s = txtRslt.Text + "_OnBarcodeFound on Managed Thread " + System.Threading.Thread.CurrentThread.ManagedThreadId + " -> ";
         AddBarcode(ref s, e.Count, e.Barcode);
         SetControlPropertyThreadSafe(txtRslt, "Text", s);
         // txtRslt.Text = s;
         System.Windows.Forms.Application.DoEvents();
     }
 }
Ejemplo n.º 3
0
        private static void Reader_BarcodeFound(object sender, BarcodeFoundEventArgs e)
        {
            Console.WriteLine("Found barcode with type '{0}' and value '{1}'", e.Barcode.Type, e.Barcode.Value);

            if (e.Count == 5)
            {
                // Cancel after 5 barcodes found
                e.Cancel = true;

                Console.WriteLine("Cancelled.");
            }
        }
 protected virtual void BarcodeFound(BarcodeFoundEventArgs e)
 {
     BarcodeFoundEvent?.Invoke(this, e);
 }
Ejemplo n.º 5
0
 private void _OnBarcodeFoundThread(object sender, BarcodeFoundEventArgs e)
 {
     lock (_lockObject)
     {
     string s = txtRslt.Text + "_OnBarcodeFound on Managed Thread " + System.Threading.Thread.CurrentThread.ManagedThreadId + " -> ";
     AddBarcode(ref s, e.Count, e.Barcode);
     SetControlPropertyThreadSafe (txtRslt, "Text", s);
     // txtRslt.Text = s;
     System.Windows.Forms.Application.DoEvents();
     }
 }
Ejemplo n.º 6
0
 private void _OnBarcodeFound(object sender, BarcodeFoundEventArgs e)
 {
     // e.cancel = (e.Count == 3);		// Cancel after 3 barcodes are found
     txtRslt.Text = txtRslt.Text + "_OnBarcodeFound -> ";
     string s = txtRslt.Text;
     AddBarcode(ref s, e.Count, e.Barcode);
     txtRslt.Text = s;
     System.Windows.Forms.Application.DoEvents();
 }