Exemplo n.º 1
0
 public static void ReceiveBarcode(string barcodeText)
 {
     /* Unfortunately JS is unable to invoke public methods of internal classes. Thus
      * we route the call to the internal class at this point. This allows us to hide away
      * the rest of the interop from the component's client. */
     BarcodeReaderInterop.OnBarcodeReceived(barcodeText);
 }
Exemplo n.º 2
0
 public void StopDecoding()
 {
     BarcodeReaderInterop.OnBarcodeReceived(string.Empty);
     _backend.StopDecoding();
     IsDecoding = false;
     StateHasChanged();
 }
Exemplo n.º 3
0
        protected override async Task OnInitializedAsync()
        {
            await base.OnInitializedAsync();

            _backend = new BarcodeReaderInterop(JSRuntime);
            await GetVideoInputDevicesAsync();

            BarcodeReaderInterop.BarcodeReceived += ReceivedBarcodeText;
            if (StartCameraAutomatically && _videoInputDevices.Count > 0)
            {
                _backend.SetVideoInputDevice(_videoInputDevices[0].DeviceId);
                StartDecoding();
            }
        }
Exemplo n.º 4
0
        protected override async Task OnInitializedAsync()
        {
            await base.OnInitializedAsync();

            _backend = new BarcodeReaderInterop(JSRuntime);
            _backend.SetLastDecodedPictureFormat(DecodedPictureCapture ? "image/jpeg" : null);

            await GetVideoInputDevicesAsync();

            BarcodeReaderInterop.BarcodeReceived += ReceivedBarcodeText;
            if (StartCameraAutomatically && _videoInputDevices.Count > 0)
            {
                _backend.SetVideoInputDevice(SelectedVideoInputId);
                StartDecoding();
            }
        }
Exemplo n.º 5
0
 public static void ReceiveNotFound()
 {
     BarcodeReaderInterop.OnNotFoundReceived();
 }