문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top