Hi there, I have an application that have 1 backgroundworker doing operation in hw through rs232 (like a pooling constantly). In my UI thread I have do operations also on that resource (rs232 resource).
The problem: When I click a button to send data over th rs232 and the worker is doing Some operation (backWorker.IsBusy == true) I send a cancelAsync to the worker, but I have to wait to perform operations.
I try to sleep the current UI Thread but holds the app.
Is any way that I can click on button (that send data over the resource), stop background, and perform the operation on button click event without user noticed?.
Now:
I have a button click and when y detect that backworker isbusy I send a cancelAsync, show a MEssagebox to the user that said "the system is busy, perform operations when a green image shows (something likie a semaphore). And then the user must click again to the same click (so annoying)
I would like this behaviour:
the worker is working all the time. So when I click the button, send the stop to the worker, wait for the resource be free and perform actions on the button event and put an advice "The actions are performing. Please wait... ", and when finish doing the button click method, something like. "Everything is ok! or some problem have found!"
I hoped to be clear. sorry about my english.
thanks in advance.
Zektor