Ejemplo n.º 1
0
        private void AddNewItemButton_Click(object sender, System.EventArgs e)
        {
            using (ScannerUserInput scannerUserInputDialog = new ScannerUserInput())
            {
                scannerUserInputDialog.ShowDialog();
                if (!IsValidInput(scannerUserInputDialog))
                {
                    return;
                }

                string newBarcodeImagePath = OnAddNewBarcode.Invoke(
                    scannerUserInputDialog.NewProductName,
                    scannerUserInputDialog.MaximalHeatingTimeInSec,
                    scannerUserInputDialog.RecognitionType,
                    scannerUserInputDialog.Category);

                ImageList.Images.Add(
                    scannerUserInputDialog.NewProductName,
                    new Bitmap(newBarcodeImagePath));

                mDisplayedImageIndex = ImageList.Images.Count - 1;
                ShowCurrentPicture();
                OnScanExistingBarcode?.Invoke(BarcodeNameLable.Text);
                Close();
            }
        }
Ejemplo n.º 2
0
 private void ScanExistingBarcodeButton_Click(object sender, System.EventArgs e)
 {
     OnScanExistingBarcode?.Invoke(BarcodeNameLable.Text);
     Close();
 }