J
JCBarton
Hi,
I have a form that shows a dialog using ShowDialog().
Whilst the dialog is displayed a worker thread that monitors files
changing on disk calls BeginInvoke() on the Form. This method displays
another dialog asking whether the user wants to update.
The problem lies in:
First dialog displayed.
<File modified on disk> - BeginInvoke() called on worker thread.
Click OK on the dialog.
.... Rather than the method that called ShowDialog() continuing - the
invoked method is run
What is the best approach to making sure the method that calls the
ShowDialog() completes and execution returns to the message loop
BEFORE the Invoked method from the worker thread is run?
Regards
John
I have a form that shows a dialog using ShowDialog().
Whilst the dialog is displayed a worker thread that monitors files
changing on disk calls BeginInvoke() on the Form. This method displays
another dialog asking whether the user wants to update.
The problem lies in:
First dialog displayed.
<File modified on disk> - BeginInvoke() called on worker thread.
Click OK on the dialog.
.... Rather than the method that called ShowDialog() continuing - the
invoked method is run
What is the best approach to making sure the method that calls the
ShowDialog() completes and execution returns to the message loop
BEFORE the Invoked method from the worker thread is run?
Regards
John