Question

I have a DLL including a class for managing audio and midi ports and connections. Whenever ports are registered or deregistered or connections are formed or released, this class fires an event, like ConnectionChanged with custom event arguments including properties Enum ChangeType and IEnumerable<Connection> ChangedConnections

Now my question is: Should I really just send the changed connections or change the property of the event args to Connections and send an IEnumerable containing all active connections?

Was it helpful?

Solution

In my opinion, the event is called "ConnectionChanged", you should include the connections that apply to that event in your event arguments. Make all active connections accessible using a member on your class.

When firing the event. You send the actual object that raised the event in the member Sender. So if someone is actually interested in all active connections, it can be obtained through the Sender object.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top