Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void BtnBuildClick(object sender, EventArgs e)
- {
- _itemsToLoad.CompleteAdding();
- Task[] runnerTasks = new Task[1];
- runnerTasks[0] = Task.Factory.StartNew(RunBuilder, TaskCreationOptions.LongRunning);
- Task.Factory.ContinueWhenAll(runnerTasks, completedTasks => TaskIsComplete());
- foreach (item in _itemsToLoad.GetConsumingEnumerable())
- WaitUntil3rdPartyIsReady();
- }
- public void WaitUntil3rdPartyIsReady()
- {
- //if this takes longer than X seconds, I want to let the user know via a message box
- //and then exit the thread and do some cleanup (close 3rd party programs that were opened as child windows)
- while (!_Window.ChildWindows.Exists(c => c.Class == "TEdit"))
- {
- }
- while (!_Window.ChildWindows.Find(c => c.Class == "TEdit").IsVisible)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement