My previous hunch was correct: before you do any actual work in the DocumentComplete event handler, make sure the ReadyState of the control equals “Complete”.
Here’s the updated diagnostic output: notice the time taken drops to three seconds now that I’m not looping through the worker code eleven different times.
'Snapper.WinForm.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Uninitialized
Uninitialized
Uninitialized
Uninitialized
Uninitialized
'Snapper.WinForm.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC\Microsoft.mshtml\7.0.3300.0__b03f5f7f11d50a3a\Microsoft.mshtml.dll'
Interactive
Interactive
Interactive
Interactive
Interactive
Interactive
Interactive
Interactive
Interactive
Interactive
Interactive
Interactive
Interactive
Interactive
12/29/2007 1:15:03 PM - DocumentCompleted!
12/29/2007 1:15:03 PM - DocumentCompleted!
Interactive
Interactive
Interactive
12/29/2007 1:15:03 PM - DocumentCompleted!
12/29/2007 1:15:03 PM - DocumentCompleted!
Interactive
Interactive
Interactive
Interactive
Interactive
12/29/2007 1:15:05 PM - DocumentCompleted!
12/29/2007 1:15:05 PM - DocumentCompleted!
Interactive
Interactive
Interactive
Interactive
Interactive
Interactive
12/29/2007 1:15:05 PM - DocumentCompleted!
12/29/2007 1:15:05 PM - DocumentCompleted!
12/29/2007 1:15:05 PM - DocumentCompleted!
12/29/2007 1:15:05 PM - DocumentCompleted!
Interactive
12/29/2007 1:15:06 PM - DocumentCompleted!
Complete
12/29/2007 1:15:06 PM - DocumentCompleted!
Doing work..
It’s probably also the case that the WebBrowserDocumentCompletedEventArgs parameter of the DocumentCompleted event handler gives me additional info with which to discriminate this ReadyState. May have to look into that one.
Recent Comments