void RaiseInvokeNotesEvent(BillValidatorBillEventArgs ea) { if (NotesAccepted != null) { NotesAccepted(this, ea); } }
void BillValidatorNotesAccepted(object sender, BillValidatorBillEventArgs e) { if (InvokeRequired) { Invoke((EventHandler<BillValidatorBillEventArgs>)BillValidatorNotesAccepted, sender, e); return; } _notesCounter += e.NoteValue; listBox1.Items.Add(String.Format("Bill accepted: {0} ({1:X2}), path {3}. Now accepted: {2:C}", e.NoteName, e.NoteCode, _notesCounter, e.RoutePath)); listBox1.SelectedIndex = listBox1.Items.Count - 1; //listBox1.SelectedIndex = -1; // There is simulator of long-working event handler Thread.Sleep(1000); }
void RaiseInvokeNotesEvent(BillValidatorBillEventArgs ea) { if (NotesAccepted != null) NotesAccepted(this, ea); }