<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Pursuit Of A Life &#187; DocumentCompleted</title>
	<atom:link href="http://thepursuitofalife.com/tag/documentcompleted/feed/" rel="self" type="application/rss+xml" />
	<link>http://thepursuitofalife.com</link>
	<description>Wouldn&#039;t you rather be writing code?</description>
	<lastBuildDate>Sun, 14 Mar 2010 03:02:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>WebBrowser.DocumentComplete Firing Multiple Times: Solution</title>
		<link>http://thepursuitofalife.com/webbrowserdocumentcomplete-firing-multiple-times-solution/</link>
		<comments>http://thepursuitofalife.com/webbrowserdocumentcomplete-firing-multiple-times-solution/#comments</comments>
		<pubDate>Sat, 29 Dec 2007 21:19:50 +0000</pubDate>
		<dc:creator>Anthony Stevens</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[DocumentCompleted]]></category>
		<category><![CDATA[ReadyState]]></category>
		<category><![CDATA[Snapper]]></category>
		<category><![CDATA[WebBrowser]]></category>

		<guid isPermaLink="false">http://xidey.wordpress.com/2007/12/29/webbrowserdocumentcomplete-firing-multiple-times-solution/</guid>
		<description><![CDATA[My previous hunch was correct: before you do any actual work in the DocumentComplete event handler, make sure the ReadyState of the control equals &#8220;Complete&#8221;.
Here&#8217;s the updated diagnostic output: notice the time taken drops to three seconds now that I&#8217;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. [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://xidey.wordpress.com/2007/12/29/webbrowserdocumentcompleted-firing-multiple-times/">previous hunch</a> was correct: before you do any actual work in the DocumentComplete event handler, make sure the ReadyState of the control equals &#8220;Complete&#8221;.</p>
<p>Here&#8217;s the updated diagnostic output: notice the time taken drops to three seconds now that I&#8217;m not looping through the worker code eleven different times.</p>
<p><code>'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.<br />
Uninitialized<br />
Uninitialized<br />
Uninitialized<br />
Uninitialized<br />
Uninitialized<br />
'Snapper.WinForm.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC\Microsoft.mshtml\7.0.3300.0__b03f5f7f11d50a3a\Microsoft.mshtml.dll'<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
12/29/2007 1:15:03 PM - DocumentCompleted!<br />
12/29/2007 1:15:03 PM - DocumentCompleted!<br />
Interactive<br />
Interactive<br />
Interactive<br />
12/29/2007 1:15:03 PM - DocumentCompleted!<br />
12/29/2007 1:15:03 PM - DocumentCompleted!<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
12/29/2007 1:15:05 PM - DocumentCompleted!<br />
12/29/2007 1:15:05 PM - DocumentCompleted!<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
12/29/2007 1:15:05 PM - DocumentCompleted!<br />
12/29/2007 1:15:05 PM - DocumentCompleted!<br />
12/29/2007 1:15:05 PM - DocumentCompleted!<br />
12/29/2007 1:15:05 PM - DocumentCompleted!<br />
Interactive<br />
12/29/2007 1:15:06 PM - DocumentCompleted!<br />
Complete<br />
12/29/2007 1:15:06 PM - DocumentCompleted!<br />
Doing work..</code></p>
<p>It&#8217;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.</p>
<div class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/Snapper" rel="tag">Snapper</a>,<a href="http://technorati.com/tags/WebBrowser" rel="tag">WebBrowser</a>,<a href="http://technorati.com/tags/DocumentCompleted" rel="tag">DocumentCompleted</a>,<a href="http://technorati.com/tags/ReadyState" rel="tag">ReadyState</a></div>
]]></content:encoded>
			<wfw:commentRss>http://thepursuitofalife.com/webbrowserdocumentcomplete-firing-multiple-times-solution/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>WebBrowser.DocumentCompleted Firing Multiple Times</title>
		<link>http://thepursuitofalife.com/webbrowserdocumentcompleted-firing-multiple-times/</link>
		<comments>http://thepursuitofalife.com/webbrowserdocumentcompleted-firing-multiple-times/#comments</comments>
		<pubDate>Sat, 29 Dec 2007 21:02:33 +0000</pubDate>
		<dc:creator>Anthony Stevens</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[DocumentCompleted]]></category>
		<category><![CDATA[Snapper]]></category>
		<category><![CDATA[WebBrowser]]></category>

		<guid isPermaLink="false">http://xidey.wordpress.com/2007/12/29/webbrowserdocumentcompleted-firing-multiple-times/</guid>
		<description><![CDATA[I&#8217;m running in to the same problem that Adi ran into wherein the DocumentCompleted event of the WebBrowser control is firing more than once.  Sometimes a lot of times!
Seems to me that this should be a Once and Only Once type of thing.
Here&#8217;s my diagnostic output when I open techcrunch.com: the timestamped lines are [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m running in to the same problem that Adi ran into wherein <a href="http://dotmad.blogspot.com/2007/05/webbrowserdocumentcompleted-is-raised.html">the DocumentCompleted event of the WebBrowser control is firing more than once</a>.  Sometimes a lot of times!</p>
<p>Seems to me that this should be a <a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself">Once and Only Once</a> type of thing.</p>
<p>Here&#8217;s my diagnostic output when I open techcrunch.com: the timestamped lines are the DocumentCompleted events; the others are the ProgressChanged events.</p>
<p><code>'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.<br />
Uninitialized<br />
Uninitialized<br />
Uninitialized<br />
Uninitialized<br />
Uninitialized<br />
'Snapper.WinForm.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC\Microsoft.mshtml\7.0.3300.0__b03f5f7f11d50a3a\Microsoft.mshtml.dll'<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
12/29/2007 1:00:23 PM - DocumentCompleted!<br />
12/29/2007 1:00:24 PM - DocumentCompleted!<br />
12/29/2007 1:00:25 PM - DocumentCompleted!<br />
Interactive<br />
Interactive<br />
12/29/2007 1:00:27 PM - DocumentCompleted!<br />
12/29/2007 1:00:29 PM - DocumentCompleted!<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
12/29/2007 1:00:31 PM - DocumentCompleted!<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
12/29/2007 1:00:33 PM - DocumentCompleted!<br />
Interactive<br />
12/29/2007 1:00:35 PM - DocumentCompleted!<br />
12/29/2007 1:00:36 PM - DocumentCompleted!<br />
Interactive<br />
Interactive<br />
12/29/2007 1:00:40 PM - DocumentCompleted!<br />
Complete<br />
12/29/2007 1:00:41 PM - DocumentCompleted!</code></p>
<p>Aside from the fact that it took 18 seconds to get this page&#8217;s contents in code (whereas FasterFox reports 8 seconds in Flock), having 11 DocumentCompleted events seems a little odd.</p>
<p><b>UPDATE:</b> Looking at this the answer seems to pop out at me.  Just wait for the ProgressChanged event to change to &#8220;Complete&#8221; before I do anything meaningful in the DocumentCompleted event handler.  I&#8217;ll give that a try right now.</p>
<div class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/Snapper" rel="tag">Snapper</a>,<a href="http://technorati.com/tags/WebBrowser" rel="tag">WebBrowser</a>,<a href="http://technorati.com/tags/DocumentCompleted" rel="tag">DocumentCompleted</a></div>
]]></content:encoded>
			<wfw:commentRss>http://thepursuitofalife.com/webbrowserdocumentcompleted-firing-multiple-times/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
