c# Programming Glossary: donavigationasync
Can I wait for a webbrowser to finish navigating, using a for loop? http://stackoverflow.com/questions/18303758/can-i-wait-for-a-webbrowser-to-finish-navigating-using-a-for-loop efficiently using async await pattern. Try this async Task DoNavigationAsync TaskCompletionSource bool tcsNavigation null TaskCompletionSource.. can access DOM here Now it's important to understand that DoNavigationAsync executes asynchronously. Here's how you'd call it from Form_Load.. of it void Form_Load object sender EventArgs e var task DoNavigationAsync task.ContinueWith t MessageBox.Show Navigation done TaskScheduler.FromCurrentSynchronizationContext..
Webbrowser behaviour issues http://stackoverflow.com/questions/18572635/webbrowser-behaviour-issues await . It illustrates how to handle onload too async Task DoNavigationAsync bool documentComplete false TaskCompletionSource bool onloadTcs.. same code without async await pattern for .NET 4.0 Task DoNavigationAsync save the correct continuation context for Task.ContinueWith.. task private void Form1_Load object sender EventArgs e DoNavigationAsync .ContinueWith _ MessageBox.Show Navigation complete TaskScheduler.FromCurrentSynchronizationContext..
|