![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
Greetings, You can tell I am nearing the end of my project as I am now posting all my little bugaboos that I do not have an answer for. I am using Merge Replication and I want to pop-up a window with an animated GIF that executes during the span of the call to Replicate the data. Now since I cannot query the state of the thread in CE, how am I going to know when the call to the Replicate method is done? Right now, I will be doing this sort of thing within my presentation layer: private void UpdateData() { MyDataReplicator myDataReplicator = new MyDataReplicator (); myPopup popup = new myPopup(); // form with animated GIF Thread thread = new Thread(new ThreadStart (myDataReplicator.Replicate())); thread.Start(); popup.Show(); while (true) { popup.Update(); // animate next frame of GIF sleep(1000); *** something here to check state of "thread" to see if it has completed execution - if true, break } popup.Dispose(); myDataReplicator.Displose(); Also, what are the best practices for disposing of a thread like this once it has completed? Note that I do not want to use Invoke to update my GUI from the delegate thread as it is in my Data Tier and making such a callback would really muck up my abstraction model. Cheers, Ian Williamson |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |