Beispiel #1
0
        public void OnBarcodeScan(string barcode)
        {
            var item = query.Read(barcode);

            BarcodeEvent?.Invoke(this, new ScannedBarcodeEventArgs(item));
            ScannedItems.Add(item);
        }
Beispiel #2
0
        /// <summary>
        /// Separating data from buffer into barcodes. Invokes BarcodeEvent for every barcode
        /// </summary>
        /// <param name="dataToProcess">Data to process</param>
        private void ProcessData(List <string> dataToProcess)
        {
            dataToProcess.ForEach(data =>
            {
                var barcodes = data.Split(Separators, StringSplitOptions.RemoveEmptyEntries).ToList();

                barcodes.ForEach(barcode =>
                {
                    var eventArgs = new BarcodeEventArgs(barcode);
                    BarcodeEvent?.Invoke(this, eventArgs);
                });
            });
        }