When using a background thread to do some lengthy possibly blocking processes, its necessary to invoke any gui update calls onto the gui thread. In all my reading I have come to the conclusion that most programmers feel that it is and should be up to the gui code to check if an invoke is necessary and perform it. But if you use the BackgroundWorker class, its reportprogress and workercompleted events somehow handle the invoke transparently.
my question is, does anyone know exactly how the the background worker does this? I have some ideas but I was just curious. Creating my own asynchronous classes that don't use the background worker, I have interest in performing this type of transparent invoke.
Its not at all important, but I am certainly curious. I'm considering decompiling the background worker class with reflector, but I haven't put all that much effort into it yet, i was just curious if anyone here had some ideas.