I am doing some work a distributed application, which uses events and
remoting to accomplish the signaling between applications. This all works.
The problem I have (I think) is that since remoting/events essentially
guarantees that you are working in a multi-threaded environment, the
developer of the application that consumes these events, if they intend on
using these events to update a UI, has to understand delegates and invokes.
Maybe that is not too much to ask, but, it would certainly be nice if that
was hidden from them.
I would like to create a little event class, that hides all the
implementation details of the remoting and events, so they simply have to
instantiate the class and tie their event handlers to my exposed events.
So, I have thought about it, but can't come up with an answer. Is there
anyway I can have my "event" class have the event handlers that the user
writes run on the same thread as the thread in which they were attached, so
the person writing the event handlers only has to care about threading
issues that they cause, not ones that my system causes...