Ejemplo n.º 1
0
        public void OnTriggerEvent(TriggerStateChangeEvent @event)
        {
            try
            {
                // only handle trigger presses
                if (@event.State)
                {
                    // turn on/off aimer, illumination and decoding
                    reader.Aim(!triggerState);
                    reader.Light(!triggerState);
                    reader.Decode(!triggerState);

                    triggerState = !triggerState;
                }
            }
            catch (ScannerNotClaimedException e)
            {
                Console.WriteLine(e.ToString());
                Console.Write(e.StackTrace);

                Toast.MakeText(this, "Scanner is not claimed", ToastLength.Short).Show();
            }
            catch (ScannerUnavailableException e)
            {
                Console.WriteLine(e.ToString());
                Console.Write(e.StackTrace);

                Toast.MakeText(this, "Scanner unavailable", ToastLength.Short).Show();
            }
        }
 public void OnTriggerEvent(TriggerStateChangeEvent triggerStateChangeEvent)
 {
     try
     {
         // only handle trigger presses
         // turn on/off aimer, illumination and decoding
         _barcodeReader.Aim(triggerStateChangeEvent.State);
         _barcodeReader.Light(triggerStateChangeEvent.State);
         _barcodeReader.Decode(triggerStateChangeEvent.State);
     }
     catch (ScannerNotClaimedException e)
     {
         Toast.MakeText(this, "Scanner is not claimed", ToastLength.Short).Show();
         ;
     }
     catch (ScannerUnavailableException e)
     {
         Toast.MakeText(this, "Scanner unavailable", ToastLength.Short).Show();
     }
 }
Ejemplo n.º 3
0
 private void _initiateScanButton_Click(object sender, EventArgs e)
 {
     _barcodeReader.Aim(true);
     _barcodeReader.Light(true);
     _barcodeReader.Decode(true);
 }