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(); } }
private void ScanExistingBarcodeButton_Click(object sender, System.EventArgs e) { OnScanExistingBarcode?.Invoke(BarcodeNameLable.Text); Close(); }