protected static void OnBarcodeReceived(BarcodeReceivedEventArgs args)
        {
            BarcodeReceivedEventHandler handler = BarcodeReceived;

            BarcodeReceived?.Invoke(args); //same as below
            // if(handler != null ){
            //    handler(this, e);
            // }
        }
        public static void OnBarcodeReceived(string barcodeText)
        {
            if (string.IsNullOrEmpty(barcodeText))
            {
                return;
            }
            /* Debounce code */
            if (barcodeText == lastCode)
            {
                return;
            }
            lastCode = barcodeText;
            BarcodeReceivedEventArgs args = new BarcodeReceivedEventArgs()
            {
                BarcodeText  = barcodeText,
                TimeReceived = DateTime.Now,
            };

            BarcodeReceived?.Invoke(args);
        }
 /// <summary>
 /// Invoked through the new, internal interop class (<see cref="BarcodeReaderInterop"/>).
 /// Will be removed as soon as <see cref="BarcodeReceived"/> is removed.
 /// </summary>
 /// <param name="args"></param>
 internal static void OnBarcodeReceived(BarcodeReceivedEventArgs args)
 {
     BarcodeReceived?.Invoke(args);
 }