private void OnCartonDeleted(object sender, CartonEventArgs e) { //Event handler for a deleted carton try { // this.txtScan.Text = ""; } catch (Exception ex) { App.ReportError(ex); } }
private void OnCartonCreated(object sender, CartonEventArgs e) { //Event handler for a created carton try { //Update display of last 10 processed cartons if (this.lstScannedCartons.Items.Count > 10) { this.lstScannedCartons.Items.RemoveAt(0); } this.lstScannedCartons.Items.Add(e.CartonScan); //Update display of total cartons scanned this.lblTotalScanned.Text = this.mStationOperator.CartonsScanned.ToString(); } catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); } }
private void OnCartonDeleted(object sender, CartonEventArgs e) { //Event handler for a deleted carton int index = 0; try { //Delete the carton if in the list if (this.lstScannedCartons.Items.Count > 0) { //Search for the deleted carton if ((index = this.lstScannedCartons.Items.IndexOf(e.CartonScan)) > -1) { this.lstScannedCartons.Items.RemoveAt(index); } } //Update display of total cartons scanned this.lblTotalScanned.Text = this.mStationOperator.CartonsScanned.ToString(); } catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); } }