Listening For and Raising Events in the BLL

Posted by OneSource on Programmers See other posts from Programmers or by OneSource
Published on 2013-10-22T09:00:55Z Indexed on 2013/10/22 10:13 UTC
Read the original article Hit count: 224

I'm working on a WinForms .Net Recording App and I have a RecordingMgr in my BLL to listen for new events captured by another class. I want to display the events in my UI and I'm stuck as to what's the best way to do this. I can think of a few scenarios to handle this but all of them seem sub-optimal:

  1. Listen for and handle Recorded Events in both the UI and in the RecordingMgr
  2. After receiving the event in the RecordingMgr, raise it again so that the UI can pick it up
  3. Create a variable in RecordingMgr (e.g., a BindingList) that the UI can bind to and update it when an Event is received
  4. Ditch the RecordingMgr and just put the event recording logic in the UI

What's the best approach? Something above or something else?

© Programmers or respective owner

Related posts about .NET

Related posts about event-programming