J
Jacob
I'm working on a class that needs to be called from a windows form, do it's
work, and then, show progress back to the main form. I'm well aware that
worker threads need to call Invoke for updates to the main thread to be
threadsafe. I want to make this worker class I'm writing a self contained
assembly so that other's can drop it into their projects. My question is:
How can I NOT force those implementing my class to have to call Invoke? Is
there a way I can do that within my class so that the progress returned is
safe to use on the main thread? What's the best way to signal that progress
has been made, an event? or some type of callback? Can I do this with
triggering an event from my worker class and listened to by the main thread,
or are events not threadsafe either?
Thanks for your help.
Jacob
work, and then, show progress back to the main form. I'm well aware that
worker threads need to call Invoke for updates to the main thread to be
threadsafe. I want to make this worker class I'm writing a self contained
assembly so that other's can drop it into their projects. My question is:
How can I NOT force those implementing my class to have to call Invoke? Is
there a way I can do that within my class so that the progress returned is
safe to use on the main thread? What's the best way to signal that progress
has been made, an event? or some type of callback? Can I do this with
triggering an event from my worker class and listened to by the main thread,
or are events not threadsafe either?
Thanks for your help.
Jacob