<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Bradleys DasBlog!</title>
    <link>http://www.bradleysblog.net/Blog/</link>
    <description>newtelligence powered</description>
    <language>en-us</language>
    <copyright>Chris Bradley, Andrea Bradley</copyright>
    <lastBuildDate>Mon, 03 Jan 2011 22:46:31 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>chrisb@pbssystems.com</managingEditor>
    <webMaster>chrisb@pbssystems.com</webMaster>
    <item>
      <trackback:ping>http://www.bradleysblog.net/Blog/Trackback.aspx?guid=e1738af8-5ca6-4bbb-9392-9863afcd01ef</trackback:ping>
      <pingback:server>http://www.bradleysblog.net/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.bradleysblog.net/Blog/PermaLink,guid,e1738af8-5ca6-4bbb-9392-9863afcd01ef.aspx</pingback:target>
      <dc:creator>chris.bradley</dc:creator>
      <wfw:comment>http://www.bradleysblog.net/Blog/CommentView,guid,e1738af8-5ca6-4bbb-9392-9863afcd01ef.aspx</wfw:comment>
      <wfw:commentRss>http://www.bradleysblog.net/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=e1738af8-5ca6-4bbb-9392-9863afcd01ef</wfw:commentRss>
      <title>Code Analysis / Metrics</title>
      <guid isPermaLink="false">http://www.bradleysblog.net/Blog/PermaLink,guid,e1738af8-5ca6-4bbb-9392-9863afcd01ef.aspx</guid>
      <link>http://www.bradleysblog.net/Blog/2011/01/03/CodeAnalysisMetrics.aspx</link>
      <pubDate>Mon, 03 Jan 2011 22:46:31 GMT</pubDate>
      <description>&lt;p&gt;
I've had this project rumbling around in the back of my head for 2 years now to find
a way of doing code analysis as part of our continuous integration build server. This
started at a business of software conference I attended in San Jose and one of the
presenters basically showed a project that broke down the cyclomatic complexity of
a codebase to help understand which areas of it are fragile. Cyclomatic complexity
sounds scary but it's basically just an algorithm for determining how complex a function
is.
&lt;/p&gt;
&lt;p&gt;
Well, being as it's christmas week and it's kinda slow around here I decided to give
this a go and thank goodness google turned up a couple gems...
&lt;/p&gt;
&lt;p&gt;
http://www.richard-banks.org/2007/01/sourcemonitor-and-cruisecontrol-top-15.html
&lt;/p&gt;
&lt;p&gt;
http://www.ridgway.co.za/archive/2006/11/28/usefulsourcemonitorreportsincruisecontrol.aspx
&lt;/p&gt;
&lt;p&gt;
The basic theory behind both these posts is to use a freeware tool called Source Monitor
to generate a code analysis which shows you complexity along with a few other metrics.
Richard does this using nant and Eden does it using msbuild but the output is basically
the same. 
&lt;/p&gt;
&lt;p&gt;
Source Monitor has an internal file format but allows you to call it from the command
line with parameters to export its data into a number of different file formats. I
pass these through a couple of XSLT's to generate nicely formatted data for my stats.
The nant commands to generate the formatted files look like this…
&lt;/p&gt;
&lt;p&gt;
&lt;command&gt;
&lt;project_file&gt;
${sourcemonitor.project}
&lt;/project_file&gt;
&lt;project_language&gt;
VB.NET
&lt;/project_language&gt;
&lt;parse_utf8_files&gt;
true
&lt;/parse_utf8_files&gt;
&lt;source_directory&gt;
${module.base}
&lt;/source_directory&gt;
&lt;include_subdirectories&gt;
true
&lt;/include_subdirectories&gt;
&lt;checkpoint_name&gt;
1
&lt;/checkpoint_name&gt;
&lt;export&gt;
&lt;export_file&gt;
${build.folder}\sourcemonitor.summary.xml
&lt;/export_file&gt;
&lt;export_type&gt;
1
&lt;/export_type&gt;
&lt;/export&gt;
&lt;/command&gt;
&lt;command&gt;
&lt;project_file&gt;
${sourcemonitor.project}
&lt;/project_file&gt;
&lt;checkpoint_name&gt;
1
&lt;/checkpoint_name&gt;
&lt;export&gt;
&lt;export_file&gt;
${build.folder}\sourcemonitor.detail.xml
&lt;/export_file&gt;
&lt;export_type&gt;
2
&lt;/export_type&gt;
&lt;/export&gt;
&lt;/command&gt;
&gt;
]]&gt; &gt;
&lt;exec program="${sourcemonitor.executable}" commandline="/C ${sourcemonitor.input}" failonerror="true" /&gt;
&lt;style style="${release.tools}\SourceMonitorOverviewGenerator.xsl" in="${build.folder}\sourcemonitor.summary.xml" out="${release.artifacts}\${module.name}.SourceMonitorOverview-Results.xml" /&gt;
&lt;style style="${release.tools}\SourceMonitorComplexityGenerator.xsl" in="${build.folder}\sourcemonitor.detail.xml" out="${release.artifacts}\${module.name}.SourceMonitorComplexity-Results.xml" /&gt;
&lt;!--delete file="${sourcemonitor.project}" /&gt;
    &lt;delete file="${build.folder}\sourcemonitor.summary.xml" /&gt;
    &lt;delete file="${build.folder}\sourcemonitor.detail.xml" /--&gt;
&gt;
&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=e1738af8-5ca6-4bbb-9392-9863afcd01ef" /&gt;</description>
      <comments>http://www.bradleysblog.net/Blog/CommentView,guid,e1738af8-5ca6-4bbb-9392-9863afcd01ef.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.bradleysblog.net/Blog/Trackback.aspx?guid=e3446232-d1c8-4f7a-aa18-b95e45d55c20</trackback:ping>
      <pingback:server>http://www.bradleysblog.net/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.bradleysblog.net/Blog/PermaLink,guid,e3446232-d1c8-4f7a-aa18-b95e45d55c20.aspx</pingback:target>
      <dc:creator>chris.bradley</dc:creator>
      <wfw:comment>http://www.bradleysblog.net/Blog/CommentView,guid,e3446232-d1c8-4f7a-aa18-b95e45d55c20.aspx</wfw:comment>
      <wfw:commentRss>http://www.bradleysblog.net/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=e3446232-d1c8-4f7a-aa18-b95e45d55c20</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've never really bought into test driven development.
</p>
        <p>
It's a funny thing. I was looking at one of our projects the other day and I thought
"jeez, without these unit tests there's no way we could support this app". And then
I got to thinking... How can I be so keen on these unit tests without ever really
pushing into TDD.
</p>
        <p>
Like I said, it's a bit of a funny thing. 
</p>
        <p>
And actually, to be totally honest, I don't really know that what I call a unit test
would cut the mustard with a unit testing purist.
</p>
        <p>
See, the unit tests I "like" are big, end to end, epic story type unit tests. None
of these verify a factory method, test a function type things. I like a test that
creates a deal, loads a vehicle, applies an insurance package, calculates a payment
and finally save the deal... Almost like a use case. 
</p>
        <p>
Now these types of test cases typically involve dozens of classes, test data elements,
and pretty in depth understandings of how the system works as a whole... But I'll
tell ya... Get a dozen or so of these in a project and it's amazing the types if things
they catch.
</p>
        <p>
I've had data bass layer issues, calc reworks, new insurance types, all sorts of "benign"
enhancements get captured by a simple unit test which behaves like a user and simply
tries to simulate a daily operation.
</p>
        <p>
I think that's why the TDD thing doesn't work for me. Seeing one class or component
act on it's own doesn't show how it "plays with others". Ultimately it's the sum of
these components working together that defines the system and unless you can relate
a test to a larger goal they just feel contrived.
</p>
        <img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=e3446232-d1c8-4f7a-aa18-b95e45d55c20" />
      </body>
      <title>Test Driven Development</title>
      <guid isPermaLink="false">http://www.bradleysblog.net/Blog/PermaLink,guid,e3446232-d1c8-4f7a-aa18-b95e45d55c20.aspx</guid>
      <link>http://www.bradleysblog.net/Blog/2010/09/30/TestDrivenDevelopment.aspx</link>
      <pubDate>Thu, 30 Sep 2010 02:56:32 GMT</pubDate>
      <description>&lt;p&gt;
I've never really bought into test driven development.
&lt;/p&gt;
&lt;p&gt;
It's a funny thing. I was looking at one of our projects the other day and I thought
"jeez, without these unit tests there's no way we could support this app". And then
I got to thinking... How can I be so keen on these unit tests without ever really
pushing into TDD.
&lt;/p&gt;
&lt;p&gt;
Like I said, it's a bit of a funny thing. 
&lt;/p&gt;
&lt;p&gt;
And actually, to be totally honest, I don't really know that what I call a unit test
would cut the mustard with a unit testing purist.
&lt;/p&gt;
&lt;p&gt;
See, the unit tests I "like" are big, end to end, epic story type unit tests. None
of these verify a factory method, test a function type things. I like a test that
creates a deal, loads a vehicle, applies an insurance package, calculates a payment
and finally save the deal... Almost like a use case. 
&lt;/p&gt;
&lt;p&gt;
Now these types of test cases typically involve dozens of classes, test data elements,
and pretty in depth understandings of how the system works as a whole... But I'll
tell ya... Get a dozen or so of these in a project and it's amazing the types if things
they catch.
&lt;/p&gt;
&lt;p&gt;
I've had data bass layer issues, calc reworks, new insurance types, all sorts of "benign"
enhancements get captured by a simple unit test which behaves like a user and simply
tries to simulate a daily operation.
&lt;/p&gt;
&lt;p&gt;
I think that's why the TDD thing doesn't work for me. Seeing one class or component
act on it's own doesn't show how it "plays with others". Ultimately it's the sum of
these components working together that defines the system and unless you can relate
a test to a larger goal they just feel contrived.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=e3446232-d1c8-4f7a-aa18-b95e45d55c20" /&gt;</description>
      <comments>http://www.bradleysblog.net/Blog/CommentView,guid,e3446232-d1c8-4f7a-aa18-b95e45d55c20.aspx</comments>
      <category>Technical</category>
    </item>
    <item>
      <trackback:ping>http://www.bradleysblog.net/Blog/Trackback.aspx?guid=2376c2ed-0b79-476d-8fa3-3861c93f00bc</trackback:ping>
      <pingback:server>http://www.bradleysblog.net/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.bradleysblog.net/Blog/PermaLink,guid,2376c2ed-0b79-476d-8fa3-3861c93f00bc.aspx</pingback:target>
      <dc:creator>chris.bradley</dc:creator>
      <wfw:comment>http://www.bradleysblog.net/Blog/CommentView,guid,2376c2ed-0b79-476d-8fa3-3861c93f00bc.aspx</wfw:comment>
      <wfw:commentRss>http://www.bradleysblog.net/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=2376c2ed-0b79-476d-8fa3-3861c93f00bc</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Had an issue all of a sudden today opening a vb6 project we use all the time. It gave
a cryptic message about a file format no longer being supported.
</p>
        <p>p.<img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=2376c2ed-0b79-476d-8fa3-3861c93f00bc" />
It turned out I had to go delete a corrupted oca file from teh vb6.exe folder. Best
thing to do is crack open process explorer to see what file it's blowing up on and
then go delete that OCA. Next time you add the reference it will get regenerated and
then things are great. Where were ya on this one google?
</p>
      </body>
      <title>VB6 - file format no longer supported</title>
      <guid isPermaLink="false">http://www.bradleysblog.net/Blog/PermaLink,guid,2376c2ed-0b79-476d-8fa3-3861c93f00bc.aspx</guid>
      <link>http://www.bradleysblog.net/Blog/2010/04/30/VB6FileFormatNoLongerSupported.aspx</link>
      <pubDate>Fri, 30 Apr 2010 21:12:04 GMT</pubDate>
      <description>&lt;p&gt;
Had an issue all of a sudden today opening a vb6 project we use all the time. It gave
a cryptic message about a file format no longer being supported.
&lt;/p&gt;
&lt;p&gt;p.&lt;img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=2376c2ed-0b79-476d-8fa3-3861c93f00bc"/&gt;It turned out I had to go delete a corrupted oca file from teh vb6.exe folder. Best thing to do is crack open process explorer to see what file it's blowing up on and then go delete that OCA. Next time you add the reference it will get regenerated and then things are great. Where were ya on this one google?</description>
      <comments>http://www.bradleysblog.net/Blog/CommentView,guid,2376c2ed-0b79-476d-8fa3-3861c93f00bc.aspx</comments>
      <category>Technical</category>
    </item>
    <item>
      <trackback:ping>http://www.bradleysblog.net/Blog/Trackback.aspx?guid=cba2da62-cb5e-4543-9dc4-6d7b358b9034</trackback:ping>
      <pingback:server>http://www.bradleysblog.net/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.bradleysblog.net/Blog/PermaLink,guid,cba2da62-cb5e-4543-9dc4-6d7b358b9034.aspx</pingback:target>
      <dc:creator>chris.bradley</dc:creator>
      <wfw:comment>http://www.bradleysblog.net/Blog/CommentView,guid,cba2da62-cb5e-4543-9dc4-6d7b358b9034.aspx</wfw:comment>
      <wfw:commentRss>http://www.bradleysblog.net/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=cba2da62-cb5e-4543-9dc4-6d7b358b9034</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
          <head>
            <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
            <meta name="ProgId" content="Word.Document" />
            <meta name="Generator" content="Microsoft Word 12" />
            <meta name="Originator" content="Microsoft Word 12" />
            <link rel="File-List" href="BlogBlah_files/filelist.xml" />
            <!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>Chris Bradley</o:Author>
  <o:Template>Normal</o:Template>
  <o:LastAuthor>Chris Bradley</o:LastAuthor>
  <o:Revision>1</o:Revision>
  <o:TotalTime>12</o:TotalTime>
  <o:Created>2010-04-05T21:15:00Z</o:Created>
  <o:LastSaved>2010-04-05T21:27:00Z</o:LastSaved>
  <o:Pages>3</o:Pages>
  <o:Words>641</o:Words>
  <o:Characters>3655</o:Characters>
  <o:Lines>30</o:Lines>
  <o:Paragraphs>8</o:Paragraphs>
  <o:CharactersWithSpaces>4288</o:CharactersWithSpaces>
  <o:Version>12.00</o:Version>
 </o:DocumentProperties>
</xml><![endif]-->
            <link rel="themeData" href="BlogBlah_files/themedata.thmx" />
            <link rel="colorSchemeMapping" href="BlogBlah_files/colorschememapping.xml" />
            <!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:TrackMoves>false</w:TrackMoves>
  <w:TrackFormatting/>
  <w:PunctuationKerning/>
  <w:DrawingGridHorizontalSpacing>5.5 pt</w:DrawingGridHorizontalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>2</w:DisplayHorizontalDrawingGridEvery>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:DoNotPromoteQF/>
  <w:LidThemeOther>EN-US</w:LidThemeOther>
  <w:LidThemeAsian>X-NONE</w:LidThemeAsian>
  <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:SplitPgBreakAndParaMark/>
   <w:DontVertAlignCellWithSp/>
   <w:DontBreakConstrainedForcedTables/>
   <w:DontVertAlignInTxbx/>
   <w:Word11KerningPairs/>
   <w:CachedColBalance/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
  <m:mathPr>
   <m:mathFont m:val="Cambria Math"/>
   <m:brkBin m:val="before"/>
   <m:brkBinSub m:val="&#45;-"/>
   <m:smallFrac m:val="off"/>
   <m:dispDef/>
   <m:lMargin m:val="0"/>
   <m:rMargin m:val="0"/>
   <m:defJc m:val="centerGroup"/>
   <m:wrapIndent m:val="1440"/>
   <m:intLim m:val="subSup"/>
   <m:naryLim m:val="undOvr"/>
  </m:mathPr></w:WordDocument>
</xml><![endif]-->
            <!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
  DefSemiHidden="true" DefQFormat="false" DefPriority="99"
  LatentStyleCount="267">
  <w:LsdException Locked="false" Priority="0" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
  <w:LsdException Locked="false" Priority="9" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 1"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 2"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 3"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 4"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 5"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 6"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 7"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 8"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 9"/>
  <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
  <w:LsdException Locked="false" Priority="10" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Title"/>
  <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
  <w:LsdException Locked="false" Priority="11" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
  <w:LsdException Locked="false" Priority="22" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
  <w:LsdException Locked="false" Priority="20" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
  <w:LsdException Locked="false" Priority="59" SemiHidden="false"
   UnhideWhenUsed="false" Name="Table Grid"/>
  <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
  <w:LsdException Locked="false" Priority="1" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 1"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
  <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
  <w:LsdException Locked="false" Priority="34" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
  <w:LsdException Locked="false" Priority="29" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
  <w:LsdException Locked="false" Priority="30" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 1"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 2"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 2"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 3"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 3"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 4"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 4"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 5"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 5"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 6"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 6"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
  <w:LsdException Locked="false" Priority="19" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
  <w:LsdException Locked="false" Priority="21" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
  <w:LsdException Locked="false" Priority="31" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
  <w:LsdException Locked="false" Priority="32" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
  <w:LsdException Locked="false" Priority="33" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
  <w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
  <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
 </w:LatentStyles>
</xml><![endif]-->
            <style>
              <!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:"";
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
span.GramE
	{mso-style-name:"";
	mso-gram-e:yes;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page Section1
	{size:11.0in 8.5in;
	mso-page-orientation:landscape;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
            </style>
            <!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-qformat:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin-top:0in;
	mso-para-margin-right:0in;
	mso-para-margin-bottom:10.0pt;
	mso-para-margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]-->
            <!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="2050"/>
</xml><![endif]-->
            <!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1"/>
 </o:shapelayout></xml><![endif]-->
          </head>
          <body lang="EN-US" style="tab-interval:.5in">
            <div class="Section1">
              <p class="MsoNormal">
I recently downloaded a copy of a new tool from red-gage called Ant Memory Profiler.
Ant Memory Profiler is an application that allows you to do memory usage analysis
on dot net apps to uncover how your app consumes memory. 
</p>
              <p class="MsoNormal">
During the course of trying out this tool we uncovered an interesting memory leak
in the dot net framework <span class="SpellE">ToolStrip</span> control. Our symptom
of this was that one of our application forms was being held in memory long after
it should have been garbage collected. After a quick tour through <span class="SpellE">google</span> I
found <span class="GramE">a some</span> references on why this is occurring and how
to ensure things get cleaned up properly.
</p>
              <p class="MsoNormal">
Here’s how we add the cleanup code to the close event of the form…
</p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Protected</span>
                  <span style="color:blue">Overrides</span>
                  <span style="color:blue">Sub</span> OnClosed(<span style="color:blue">ByVal</span> e <span style="color:blue">As</span> System.EventArgs)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">MyBase</span>.OnClosed(e)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <o:p> </o:p>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:green">'note,
this call is still required as it cleans up one set of extra handlers<o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>reportViewer.Toolbar.Visible
= <span style="color:blue">False<o:p></o:p></span></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:yes">
                  <o:p> </o:p>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:green">'this
is the really ugly stuff though, let our cleanup class take care of things<o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Dim</span> gc2 <span style="color:blue">As</span><span style="color:blue">New</span> ToolStripGarbageCollector<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>gc2.RemoveHandlers(reportViewer)<o:p></o:p></span>
              </p>
              <p class="MsoNormal">
                <span style="font-size:10.0pt;line-height:115%;font-family:&#xA;&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">End</span>
                  <span style="color:blue">Sub<o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal">
                <span class="GramE">And <span class="SpellE">heres</span> the meat behind the cleanup
class.</span> Don’t ask what this does, it’s pretty much a copy and paste I found
from some newsgroups. 
</p>
              <p class="MsoNormal">
                <o:p> </o:p>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Public</span>
                  <span style="color:blue">Class</span> ToolStripGarbageCollector<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Private</span>
                  <span style="color:blue">Const</span> EVENTHANDLER_ON_USER_PREFERENCE_CHANGED <span style="color:blue">As</span><span style="color:blue">String</span> = <span style="color:#A31515">"OnUserPreferenceChanged"<o:p></o:p></span></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Private</span>
                  <span style="color:blue">Const</span> LIST_HANDLERS <span style="color:blue">As</span><span style="color:blue">String</span> = <span style="color:#A31515">"_handlers"<o:p></o:p></span></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Private</span>
                  <span style="color:blue">Const</span> ON_USER_PREFERENCE_CHANGED_EVENT <span style="color:blue">As</span><span style="color:blue">String</span> = <span style="color:#A31515">"OnUserPreferenceChangedEvent"<o:p></o:p></span></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Private</span>
                  <span style="color:blue">Const</span> SYSTEM_EVENT_INVOKE_INFO <span style="color:blue">As</span><span style="color:blue">String</span> = <span style="color:#A31515">"SystemEventInvokeInfo"<o:p></o:p></span></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Private</span>
                  <span style="color:blue">Const</span> TARGET_DELEGATE <span style="color:blue">As</span><span style="color:blue">String</span> = <span style="color:#A31515">"_delegate"<o:p></o:p></span></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;color:#A31515;mso-no-proof:yes">
                  <o:p> </o:p>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;color:#A31515;mso-no-proof:yes">
                  <o:p> </o:p>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Public</span>
                  <span style="color:blue">Sub</span> RemoveHandlers(<span style="color:blue">ByVal</span> ctrl <span style="color:blue">As</span> Control)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>NavigateControls(ctrl)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">End</span>
                  <span style="color:blue">Sub<o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:yes">
                  <o:p> </o:p>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:yes">
                  <o:p> </o:p>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Public</span>
                  <span style="color:blue">Sub</span> NavigateControls(<span style="color:blue">ByVal</span> ctrl <span style="color:blue">As</span> Control)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>Console.WriteLine(ctrl.Name
&amp; <span style="color:#A31515">"-"</span> &amp; ctrl.GetType.FullName)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <o:p> </o:p>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">If</span> ctrl.GetType.FullName
= <span style="color:#A31515">"System.Windows.Forms.ToolStripTextBox+ToolStripTextBoxControl"</span><span style="color:blue">Then<o:p></o:p></span></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>RemoveUpcHandler(ctrl)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">ElseIf</span> ctrl.GetType.FullName
= <span style="color:#A31515">"System.Windows.Forms.ToolStrip"</span><span style="color:blue">Then<o:p></o:p></span></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>RemoveUpcHandler(ctrl)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">End</span>
                  <span style="color:blue">If<o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:yes">
                  <o:p> </o:p>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">For</span>
                  <span style="color:blue">Each</span> c <span style="color:blue">As</span> Control <span style="color:blue">In</span> ctrl.Controls<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>NavigateControls(c)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Next<o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">End</span>
                  <span style="color:blue">Sub<o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:yes">
                  <o:p> </o:p>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Private</span>
                  <span style="color:blue">Sub</span> RemoveUpcHandler(<span style="color:blue">ByVal</span> ctrl <span style="color:blue">As</span> Control)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:green">'create
the delegate to OnUserPreferenceChanged<span style="mso-spacerun:yes"></span><o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Dim</span> d <span style="color:blue">As</span> [Delegate]
= [Delegate].CreateDelegate(<span style="color:blue">GetType</span>(Microsoft.Win32.UserPreferenceChangedEventHandler),
ctrl, EVENTHANDLER_ON_USER_PREFERENCE_CHANGED)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <o:p> </o:p>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Dim</span> handlers <span style="color:blue">As</span><span style="color:blue">Object</span> = <span style="color:blue">GetType</span>(Microsoft.Win32.SystemEvents).GetField(<span style="color:#A31515">"_handlers"</span>,
Reflection.BindingFlags.NonPublic <span style="color:blue">Or</span> Reflection.BindingFlags.Static).GetValue(<span style="color:blue">Nothing</span>)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Dim</span> upcHandler <span style="color:blue">As</span><span style="color:blue">Object</span> = <span style="color:blue">GetType</span>(Microsoft.Win32.SystemEvents).GetField(ON_USER_PREFERENCE_CHANGED_EVENT,
Reflection.BindingFlags.NonPublic <span style="color:blue">Or</span> Reflection.BindingFlags.Static).GetValue(<span style="color:blue">Nothing</span>)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:green">'get
a SystemEventInvokeInfo type<span style="mso-spacerun:yes"></span><o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Dim</span> systemEventInvokeInfo <span style="color:blue">As</span><span style="color:blue">Object</span> = <span style="color:blue">GetType</span>(Microsoft.Win32.SystemEvents).GetNestedType(SYSTEM_EVENT_INVOKE_INFO,
Reflection.BindingFlags.NonPublic <span style="color:blue">Or</span> Reflection.BindingFlags.Instance)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:green">'get
the SystemEventInvokeInfo list for the UserPreferenceChangedEvent<span style="mso-spacerun:yes"></span><o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Dim</span> upcHandlerList <span style="color:blue">As</span> IList
= <span style="color:blue">CType</span>(<span style="color:blue">CType</span>(handlers,
IDictionary).Item(upcHandler), IList)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <o:p> </o:p>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:green">'initialize
a target count<span style="mso-spacerun:yes"></span><o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Dim</span> targetCount <span style="color:blue">As</span><span style="color:blue">Integer</span> =
0<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Dim</span> i <span style="color:blue">As</span><span style="color:blue">Integer</span> =
0<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:green">'loop<span style="mso-spacerun:yes"></span><o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">While</span> i
&lt; upcHandlerList.Count<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>systemEventInvokeInfo
= upcHandlerList(i)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:green">'get
the SystemEventInvokeInfo._delegate field<span style="mso-spacerun:yes"></span><o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Dim</span> target <span style="color:blue">As</span> [Delegate]
= <span style="color:blue">CType</span>(systemEventInvokeInfo.GetType().GetField(TARGET_DELEGATE,
Reflection.BindingFlags.NonPublic <span style="color:blue">Or</span> Reflection.BindingFlags.Instance).GetValue(systemEventInvokeInfo),
[Delegate])<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:green">'eval<span style="mso-spacerun:yes"></span><o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">If</span> target.Target <span style="color:blue">Is</span> d.Target <span style="color:blue">Then<o:p></o:p></span></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:green">'increment
on positive ID<span style="mso-spacerun:yes"></span><o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="mso-spacerun:yes">
                  </span>targetCount
+= 1<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">End</span>
                  <span style="color:blue">If<o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>i
+= 1<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">End</span>
                  <span style="color:blue">While<o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:green">'remove
the handlers<span style="mso-spacerun:yes"></span><o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">For</span> i
= 1 <span style="color:blue">To</span> targetCount<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">RemoveHandler</span> Microsoft.Win32.SystemEvents.UserPreferenceChanged, <span style="color:blue">CType</span>(d,
Microsoft.Win32.UserPreferenceChangedEventHandler)<o:p></o:p></span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">Next<o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="mso-spacerun:yes">
                  </span>
                  <span style="color:blue">End</span>
                  <span style="color:blue">Sub<o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:yes">
                  <o:p> </o:p>
                </span>
              </p>
              <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:&#xA;normal;mso-layout-grid-align:none;text-autospace:none">
                <span style="font-size:&#xA;10.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:yes">End</span>
                <span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
                  <span style="color:blue">Class<o:p></o:p></span>
                </span>
              </p>
              <p class="MsoNormal">
                <o:p> </o:p>
              </p>
            </div>
          </body>
        </html>
        <img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=cba2da62-cb5e-4543-9dc4-6d7b358b9034" />
      </body>
      <title>ToolStripTextBox Memory Leaks</title>
      <guid isPermaLink="false">http://www.bradleysblog.net/Blog/PermaLink,guid,cba2da62-cb5e-4543-9dc4-6d7b358b9034.aspx</guid>
      <link>http://www.bradleysblog.net/Blog/2010/04/05/ToolStripTextBoxMemoryLeaks.aspx</link>
      <pubDate>Mon, 05 Apr 2010 21:28:57 GMT</pubDate>
      <description>&lt;html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"&gt;
&lt;head&gt;
&lt;meta http-equiv=Content-Type content="text/html; charset=windows-1252"&gt;
&lt;meta name=ProgId content=Word.Document&gt;
&lt;meta name=Generator content="Microsoft Word 12"&gt;
&lt;meta name=Originator content="Microsoft Word 12"&gt;
&lt;link rel=File-List href="BlogBlah_files/filelist.xml"&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:DocumentProperties&gt;
  &lt;o:Author&gt;Chris Bradley&lt;/o:Author&gt;
  &lt;o:Template&gt;Normal&lt;/o:Template&gt;
  &lt;o:LastAuthor&gt;Chris Bradley&lt;/o:LastAuthor&gt;
  &lt;o:Revision&gt;1&lt;/o:Revision&gt;
  &lt;o:TotalTime&gt;12&lt;/o:TotalTime&gt;
  &lt;o:Created&gt;2010-04-05T21:15:00Z&lt;/o:Created&gt;
  &lt;o:LastSaved&gt;2010-04-05T21:27:00Z&lt;/o:LastSaved&gt;
  &lt;o:Pages&gt;3&lt;/o:Pages&gt;
  &lt;o:Words&gt;641&lt;/o:Words&gt;
  &lt;o:Characters&gt;3655&lt;/o:Characters&gt;
  &lt;o:Lines&gt;30&lt;/o:Lines&gt;
  &lt;o:Paragraphs&gt;8&lt;/o:Paragraphs&gt;
  &lt;o:CharactersWithSpaces&gt;4288&lt;/o:CharactersWithSpaces&gt;
  &lt;o:Version&gt;12.00&lt;/o:Version&gt;
 &lt;/o:DocumentProperties&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;link rel=themeData href="BlogBlah_files/themedata.thmx"&gt;
&lt;link rel=colorSchemeMapping href="BlogBlah_files/colorschememapping.xml"&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:SpellingState&gt;Clean&lt;/w:SpellingState&gt;
  &lt;w:GrammarState&gt;Clean&lt;/w:GrammarState&gt;
  &lt;w:TrackMoves&gt;false&lt;/w:TrackMoves&gt;
  &lt;w:TrackFormatting/&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:DrawingGridHorizontalSpacing&gt;5.5 pt&lt;/w:DrawingGridHorizontalSpacing&gt;
  &lt;w:DisplayHorizontalDrawingGridEvery&gt;2&lt;/w:DisplayHorizontalDrawingGridEvery&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:DoNotPromoteQF/&gt;
  &lt;w:LidThemeOther&gt;EN-US&lt;/w:LidThemeOther&gt;
  &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;
  &lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
   &lt;w:SplitPgBreakAndParaMark/&gt;
   &lt;w:DontVertAlignCellWithSp/&gt;
   &lt;w:DontBreakConstrainedForcedTables/&gt;
   &lt;w:DontVertAlignInTxbx/&gt;
   &lt;w:Word11KerningPairs/&gt;
   &lt;w:CachedColBalance/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
  &lt;m:mathPr&gt;
   &lt;m:mathFont m:val="Cambria Math"/&gt;
   &lt;m:brkBin m:val="before"/&gt;
   &lt;m:brkBinSub m:val="&amp;#45;-"/&gt;
   &lt;m:smallFrac m:val="off"/&gt;
   &lt;m:dispDef/&gt;
   &lt;m:lMargin m:val="0"/&gt;
   &lt;m:rMargin m:val="0"/&gt;
   &lt;m:defJc m:val="centerGroup"/&gt;
   &lt;m:wrapIndent m:val="1440"/&gt;
   &lt;m:intLim m:val="subSup"/&gt;
   &lt;m:naryLim m:val="undOvr"/&gt;
  &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
  DefSemiHidden="true" DefQFormat="false" DefPriority="99"
  LatentStyleCount="267"&gt;
  &lt;w:LsdException Locked="false" Priority="0" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Normal"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="heading 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 7"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 8"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 9"/&gt;
  &lt;w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/&gt;
  &lt;w:LsdException Locked="false" Priority="10" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Title"/&gt;
  &lt;w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/&gt;
  &lt;w:LsdException Locked="false" Priority="11" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/&gt;
  &lt;w:LsdException Locked="false" Priority="22" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Strong"/&gt;
  &lt;w:LsdException Locked="false" Priority="20" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/&gt;
  &lt;w:LsdException Locked="false" Priority="59" SemiHidden="false"
   UnhideWhenUsed="false" Name="Table Grid"/&gt;
  &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/&gt;
  &lt;w:LsdException Locked="false" Priority="1" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/&gt;
  &lt;w:LsdException Locked="false" Priority="34" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/&gt;
  &lt;w:LsdException Locked="false" Priority="29" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Quote"/&gt;
  &lt;w:LsdException Locked="false" Priority="30" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="19" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/&gt;
  &lt;w:LsdException Locked="false" Priority="21" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/&gt;
  &lt;w:LsdException Locked="false" Priority="31" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/&gt;
  &lt;w:LsdException Locked="false" Priority="32" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/&gt;
  &lt;w:LsdException Locked="false" Priority="33" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Book Title"/&gt;
  &lt;w:LsdException Locked="false" Priority="37" Name="Bibliography"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:"";
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
span.GramE
	{mso-style-name:"";
	mso-gram-e:yes;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page Section1
	{size:11.0in 8.5in;
	mso-page-orientation:landscape;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;
&lt;/style&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-qformat:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin-top:0in;
	mso-para-margin-right:0in;
	mso-para-margin-bottom:10.0pt;
	mso-para-margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:shapedefaults v:ext="edit" spidmax="2050"/&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:shapelayout v:ext="edit"&gt;
  &lt;o:idmap v:ext="edit" data="1"/&gt;
 &lt;/o:shapelayout&gt;&lt;/xml&gt;&lt;![endif]--&gt;
&lt;/head&gt;
&lt;body lang=EN-US style='tab-interval:.5in'&gt;
&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
I recently downloaded a copy of a new tool from red-gage called Ant Memory Profiler.
Ant Memory Profiler is an application that allows you to do memory usage analysis
on dot net apps to uncover how your app consumes memory. 
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
During the course of trying out this tool we uncovered an interesting memory leak
in the dot net framework &lt;span class=SpellE&gt;ToolStrip&lt;/span&gt; control. Our symptom
of this was that one of our application forms was being held in memory long after
it should have been garbage collected. After a quick tour through &lt;span class=SpellE&gt;google&lt;/span&gt; I
found &lt;span class=GramE&gt;a some&lt;/span&gt; references on why this is occurring and how
to ensure things get cleaned up properly.
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
Here’s how we add the cleanup code to the close event of the form…
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Protected&lt;/span&gt; &lt;span style='color:blue'&gt;Overrides&lt;/span&gt; &lt;span style='color:blue'&gt;Sub&lt;/span&gt; OnClosed(&lt;span style='color:blue'&gt;ByVal&lt;/span&gt; e &lt;span style='color:blue'&gt;As&lt;/span&gt; System.EventArgs)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;MyBase&lt;/span&gt;.OnClosed(e)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:green'&gt;'note,
this call is still required as it cleans up one set of extra handlers&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;reportViewer.Toolbar.Visible
= &lt;span style='color:blue'&gt;False&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";color:blue;mso-no-proof:yes'&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:green'&gt;'this
is the really ugly stuff though, let our cleanup class take care of things&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Dim&lt;/span&gt; gc2 &lt;span style='color:blue'&gt;As&lt;/span&gt; &lt;span style='color:blue'&gt;New&lt;/span&gt; ToolStripGarbageCollector&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;gc2.RemoveHandlers(reportViewer)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style='font-size:10.0pt;line-height:115%;font-family:
"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;End&lt;/span&gt; &lt;span style='color:blue'&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span class=GramE&gt;And &lt;span class=SpellE&gt;heres&lt;/span&gt; the meat behind the cleanup
class.&lt;/span&gt; Don’t ask what this does, it’s pretty much a copy and paste I found
from some newsgroups. 
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Public&lt;/span&gt; &lt;span style='color:blue'&gt;Class&lt;/span&gt; ToolStripGarbageCollector&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Private&lt;/span&gt; &lt;span style='color:blue'&gt;Const&lt;/span&gt; EVENTHANDLER_ON_USER_PREFERENCE_CHANGED &lt;span style='color:blue'&gt;As&lt;/span&gt; &lt;span style='color:blue'&gt;String&lt;/span&gt; = &lt;span style='color:#A31515'&gt;&amp;quot;OnUserPreferenceChanged&amp;quot;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Private&lt;/span&gt; &lt;span style='color:blue'&gt;Const&lt;/span&gt; LIST_HANDLERS &lt;span style='color:blue'&gt;As&lt;/span&gt; &lt;span style='color:blue'&gt;String&lt;/span&gt; = &lt;span style='color:#A31515'&gt;&amp;quot;_handlers&amp;quot;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Private&lt;/span&gt; &lt;span style='color:blue'&gt;Const&lt;/span&gt; ON_USER_PREFERENCE_CHANGED_EVENT &lt;span style='color:blue'&gt;As&lt;/span&gt; &lt;span style='color:blue'&gt;String&lt;/span&gt; = &lt;span style='color:#A31515'&gt;&amp;quot;OnUserPreferenceChangedEvent&amp;quot;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Private&lt;/span&gt; &lt;span style='color:blue'&gt;Const&lt;/span&gt; SYSTEM_EVENT_INVOKE_INFO &lt;span style='color:blue'&gt;As&lt;/span&gt; &lt;span style='color:blue'&gt;String&lt;/span&gt; = &lt;span style='color:#A31515'&gt;&amp;quot;SystemEventInvokeInfo&amp;quot;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Private&lt;/span&gt; &lt;span style='color:blue'&gt;Const&lt;/span&gt; TARGET_DELEGATE &lt;span style='color:blue'&gt;As&lt;/span&gt; &lt;span style='color:blue'&gt;String&lt;/span&gt; = &lt;span style='color:#A31515'&gt;&amp;quot;_delegate&amp;quot;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";color:#A31515;mso-no-proof:yes'&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";color:#A31515;mso-no-proof:yes'&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Public&lt;/span&gt; &lt;span style='color:blue'&gt;Sub&lt;/span&gt; RemoveHandlers(&lt;span style='color:blue'&gt;ByVal&lt;/span&gt; ctrl &lt;span style='color:blue'&gt;As&lt;/span&gt; Control)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;NavigateControls(ctrl)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;End&lt;/span&gt; &lt;span style='color:blue'&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";color:blue;mso-no-proof:yes'&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";color:blue;mso-no-proof:yes'&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Public&lt;/span&gt; &lt;span style='color:blue'&gt;Sub&lt;/span&gt; NavigateControls(&lt;span style='color:blue'&gt;ByVal&lt;/span&gt; ctrl &lt;span style='color:blue'&gt;As&lt;/span&gt; Control)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;Console.WriteLine(ctrl.Name
&amp;amp; &lt;span style='color:#A31515'&gt;&amp;quot;-&amp;quot;&lt;/span&gt; &amp;amp; ctrl.GetType.FullName)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;If&lt;/span&gt; ctrl.GetType.FullName
= &lt;span style='color:#A31515'&gt;&amp;quot;System.Windows.Forms.ToolStripTextBox+ToolStripTextBoxControl&amp;quot;&lt;/span&gt; &lt;span style='color:blue'&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;RemoveUpcHandler(ctrl)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;ElseIf&lt;/span&gt; ctrl.GetType.FullName
= &lt;span style='color:#A31515'&gt;&amp;quot;System.Windows.Forms.ToolStrip&amp;quot;&lt;/span&gt; &lt;span style='color:blue'&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;RemoveUpcHandler(ctrl)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;End&lt;/span&gt; &lt;span style='color:blue'&gt;If&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";color:blue;mso-no-proof:yes'&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;For&lt;/span&gt; &lt;span style='color:blue'&gt;Each&lt;/span&gt; c &lt;span style='color:blue'&gt;As&lt;/span&gt; Control &lt;span style='color:blue'&gt;In&lt;/span&gt; ctrl.Controls&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;NavigateControls(c)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Next&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;End&lt;/span&gt; &lt;span style='color:blue'&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";color:blue;mso-no-proof:yes'&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Private&lt;/span&gt; &lt;span style='color:blue'&gt;Sub&lt;/span&gt; RemoveUpcHandler(&lt;span style='color:blue'&gt;ByVal&lt;/span&gt; ctrl &lt;span style='color:blue'&gt;As&lt;/span&gt; Control)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:green'&gt;'create
the delegate to OnUserPreferenceChanged&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Dim&lt;/span&gt; d &lt;span style='color:blue'&gt;As&lt;/span&gt; [Delegate]
= [Delegate].CreateDelegate(&lt;span style='color:blue'&gt;GetType&lt;/span&gt;(Microsoft.Win32.UserPreferenceChangedEventHandler),
ctrl, EVENTHANDLER_ON_USER_PREFERENCE_CHANGED)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Dim&lt;/span&gt; handlers &lt;span style='color:blue'&gt;As&lt;/span&gt; &lt;span style='color:blue'&gt;Object&lt;/span&gt; = &lt;span style='color:blue'&gt;GetType&lt;/span&gt;(Microsoft.Win32.SystemEvents).GetField(&lt;span style='color:#A31515'&gt;&amp;quot;_handlers&amp;quot;&lt;/span&gt;,
Reflection.BindingFlags.NonPublic &lt;span style='color:blue'&gt;Or&lt;/span&gt; Reflection.BindingFlags.Static).GetValue(&lt;span style='color:blue'&gt;Nothing&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Dim&lt;/span&gt; upcHandler &lt;span style='color:blue'&gt;As&lt;/span&gt; &lt;span style='color:blue'&gt;Object&lt;/span&gt; = &lt;span style='color:blue'&gt;GetType&lt;/span&gt;(Microsoft.Win32.SystemEvents).GetField(ON_USER_PREFERENCE_CHANGED_EVENT,
Reflection.BindingFlags.NonPublic &lt;span style='color:blue'&gt;Or&lt;/span&gt; Reflection.BindingFlags.Static).GetValue(&lt;span style='color:blue'&gt;Nothing&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:green'&gt;'get
a SystemEventInvokeInfo type&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Dim&lt;/span&gt; systemEventInvokeInfo &lt;span style='color:blue'&gt;As&lt;/span&gt; &lt;span style='color:blue'&gt;Object&lt;/span&gt; = &lt;span style='color:blue'&gt;GetType&lt;/span&gt;(Microsoft.Win32.SystemEvents).GetNestedType(SYSTEM_EVENT_INVOKE_INFO,
Reflection.BindingFlags.NonPublic &lt;span style='color:blue'&gt;Or&lt;/span&gt; Reflection.BindingFlags.Instance)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:green'&gt;'get
the SystemEventInvokeInfo list for the UserPreferenceChangedEvent&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Dim&lt;/span&gt; upcHandlerList &lt;span style='color:blue'&gt;As&lt;/span&gt; IList
= &lt;span style='color:blue'&gt;CType&lt;/span&gt;(&lt;span style='color:blue'&gt;CType&lt;/span&gt;(handlers,
IDictionary).Item(upcHandler), IList)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:green'&gt;'initialize
a target count&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Dim&lt;/span&gt; targetCount &lt;span style='color:blue'&gt;As&lt;/span&gt; &lt;span style='color:blue'&gt;Integer&lt;/span&gt; =
0&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Dim&lt;/span&gt; i &lt;span style='color:blue'&gt;As&lt;/span&gt; &lt;span style='color:blue'&gt;Integer&lt;/span&gt; =
0&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:green'&gt;'loop&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;While&lt;/span&gt; i
&amp;lt; upcHandlerList.Count&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;systemEventInvokeInfo
= upcHandlerList(i)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:green'&gt;'get
the SystemEventInvokeInfo._delegate field&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Dim&lt;/span&gt; target &lt;span style='color:blue'&gt;As&lt;/span&gt; [Delegate]
= &lt;span style='color:blue'&gt;CType&lt;/span&gt;(systemEventInvokeInfo.GetType().GetField(TARGET_DELEGATE,
Reflection.BindingFlags.NonPublic &lt;span style='color:blue'&gt;Or&lt;/span&gt; Reflection.BindingFlags.Instance).GetValue(systemEventInvokeInfo),
[Delegate])&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:green'&gt;'eval&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;If&lt;/span&gt; target.Target &lt;span style='color:blue'&gt;Is&lt;/span&gt; d.Target &lt;span style='color:blue'&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:green'&gt;'increment
on positive ID&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;targetCount
+= 1&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;End&lt;/span&gt; &lt;span style='color:blue'&gt;If&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;i
+= 1&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;End&lt;/span&gt; &lt;span style='color:blue'&gt;While&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:green'&gt;'remove
the handlers&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;For&lt;/span&gt; i
= 1 &lt;span style='color:blue'&gt;To&lt;/span&gt; targetCount&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;RemoveHandler&lt;/span&gt; Microsoft.Win32.SystemEvents.UserPreferenceChanged, &lt;span style='color:blue'&gt;CType&lt;/span&gt;(d,
Microsoft.Win32.UserPreferenceChangedEventHandler)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;Next&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt;&lt;span style='mso-spacerun:yes'&gt; &lt;/span&gt;&lt;span style='color:blue'&gt;End&lt;/span&gt; &lt;span style='color:blue'&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";color:blue;mso-no-proof:yes'&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none'&gt;
&lt;span style='font-size:
10.0pt;font-family:"Courier New";color:blue;mso-no-proof:yes'&gt;End&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";mso-no-proof:yes'&gt; &lt;span style='color:blue'&gt;Class&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=cba2da62-cb5e-4543-9dc4-6d7b358b9034" /&gt;</description>
      <comments>http://www.bradleysblog.net/Blog/CommentView,guid,cba2da62-cb5e-4543-9dc4-6d7b358b9034.aspx</comments>
      <category>Technical</category>
    </item>
    <item>
      <trackback:ping>http://www.bradleysblog.net/Blog/Trackback.aspx?guid=2e167928-3df0-4b4e-9f84-ab3b844956ea</trackback:ping>
      <pingback:server>http://www.bradleysblog.net/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.bradleysblog.net/Blog/PermaLink,guid,2e167928-3df0-4b4e-9f84-ab3b844956ea.aspx</pingback:target>
      <dc:creator>chris.bradley</dc:creator>
      <wfw:comment>http://www.bradleysblog.net/Blog/CommentView,guid,2e167928-3df0-4b4e-9f84-ab3b844956ea.aspx</wfw:comment>
      <wfw:commentRss>http://www.bradleysblog.net/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=2e167928-3df0-4b4e-9f84-ab3b844956ea</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've been meaning to write down something on this for a couple weeks now but have
been having a tough time formulating a nice message on this. The short version is
be very carefull doing this. I believe that somehow AppDomain's rely on something
out of the Windows User Profile, and over time in a Windows Service when you're loading
and unloading AppDomain's stuff MAY get screwed up.
</p>
        <p>
We had a scheduler app which basically used AppDomain's as an isolation mechanism
for controlling when and how each scheduled component was called and then disposed.
Code looked something like this...
</p>
        <p>
for each s as ScheduledComponent in myList<br />
Dim d as new AppDomain<br />
try<br />
dim i as IExecutableInstance = d.CreateInstance("LaunchPad")<br />
i.Execute<br />
finally<br />
AppDomain.Unload(d)<br />
end try<br />
next<br /></p>
        <p>
Over time we'd eventually get into a state where the entire scheduler service which
just cause a windows segmentation fault and shut down. No nice dot net exception or
anything. Like I said, our best guess is that something gets out of sync between the
windows profile and whatever exists in a dot net AppDomain.
</p>
        <p>
Anyway, our solution was to create a wrapper layer which basically called each scheduled
component as a process instead. This seems to be working very reliably ever since.
</p>
        <img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=2e167928-3df0-4b4e-9f84-ab3b844956ea" />
      </body>
      <title>AppDomains in Windows Services</title>
      <guid isPermaLink="false">http://www.bradleysblog.net/Blog/PermaLink,guid,2e167928-3df0-4b4e-9f84-ab3b844956ea.aspx</guid>
      <link>http://www.bradleysblog.net/Blog/2010/02/27/AppDomainsInWindowsServices.aspx</link>
      <pubDate>Sat, 27 Feb 2010 16:00:42 GMT</pubDate>
      <description>&lt;p&gt;
I've been meaning to write down something on this for a couple weeks now but have
been having a tough time formulating a nice message on this. The short version is
be very carefull doing this. I believe that somehow AppDomain's rely on something
out of the Windows User Profile, and over time in a Windows Service when you're loading
and unloading AppDomain's stuff MAY get screwed up.
&lt;/p&gt;
&lt;p&gt;
We had a scheduler app which basically used AppDomain's as an isolation mechanism
for controlling when and how each scheduled component was called and then disposed.
Code looked something like this...
&lt;/p&gt;
&lt;p&gt;
for each s as ScheduledComponent in myList&lt;br&gt;
Dim d as new AppDomain&lt;br&gt;
try&lt;br&gt;
dim i as IExecutableInstance = d.CreateInstance("LaunchPad")&lt;br&gt;
i.Execute&lt;br&gt;
finally&lt;br&gt;
AppDomain.Unload(d)&lt;br&gt;
end try&lt;br&gt;
next&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Over time we'd eventually get into a state where the entire scheduler service which
just cause a windows segmentation fault and shut down. No nice dot net exception or
anything. Like I said, our best guess is that something gets out of sync between the
windows profile and whatever exists in a dot net AppDomain.
&lt;/p&gt;
&lt;p&gt;
Anyway, our solution was to create a wrapper layer which basically called each scheduled
component as a process instead. This seems to be working very reliably ever since.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=2e167928-3df0-4b4e-9f84-ab3b844956ea" /&gt;</description>
      <comments>http://www.bradleysblog.net/Blog/CommentView,guid,2e167928-3df0-4b4e-9f84-ab3b844956ea.aspx</comments>
      <category>Technical</category>
    </item>
    <item>
      <trackback:ping>http://www.bradleysblog.net/Blog/Trackback.aspx?guid=470370c8-d4fa-48a7-b4df-5298685d68a7</trackback:ping>
      <pingback:server>http://www.bradleysblog.net/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.bradleysblog.net/Blog/PermaLink,guid,470370c8-d4fa-48a7-b4df-5298685d68a7.aspx</pingback:target>
      <dc:creator>chris.bradley</dc:creator>
      <wfw:comment>http://www.bradleysblog.net/Blog/CommentView,guid,470370c8-d4fa-48a7-b4df-5298685d68a7.aspx</wfw:comment>
      <wfw:commentRss>http://www.bradleysblog.net/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=470370c8-d4fa-48a7-b4df-5298685d68a7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
We were having some problems on our development machines at work as soon as we upgraded
to Windows 7 and IE8. The problem first manifested itself as a javascript "client
out of memory" error while using Outlook Web Access (OWA) but it seemed like randomly
we'd have javascript errors while navigating webpages.
</p>
        <p>
Our workaround was to switch over to Google Chrome but then you start finding all
the things that don't work with that so we just wanted to get this figured out.
</p>
        <p>
We ended up working microsoft support on this one and long story short, it looks like
one of our development tools is overwriting one of the IE classes. They had us re-register
a couple classes and now it's working awesome. Here's the registery changes required...
</p>
        <p>
[HKEY_CLASSES_ROOT\Interface\{79EAC9C5-BAF9-11CE-8C82-00AA004BA90B}]<br />
@="IHlinkFrame"<br /><br />
[HKEY_CLASSES_ROOT\Interface\{79EAC9C5-BAF9-11CE-8C82-00AA004BA90B}\NumMethods]<br />
@="8"<br /><br />
[HKEY_CLASSES_ROOT\Interface\{79EAC9C5-BAF9-11CE-8C82-00AA004BA90B}\ProxyStubClsid32]<br />
@="{A4A1A128-768F-41E0-BF75-E4FDDD701CBA}"<br /></p>
        <img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=470370c8-d4fa-48a7-b4df-5298685d68a7" />
      </body>
      <title>Windows 7 / Internet Explorer 8 Javascript</title>
      <guid isPermaLink="false">http://www.bradleysblog.net/Blog/PermaLink,guid,470370c8-d4fa-48a7-b4df-5298685d68a7.aspx</guid>
      <link>http://www.bradleysblog.net/Blog/2010/01/26/Windows7InternetExplorer8Javascript.aspx</link>
      <pubDate>Tue, 26 Jan 2010 15:39:45 GMT</pubDate>
      <description>&lt;p&gt;
We were having some problems on our development machines at work as soon as we upgraded
to Windows 7 and IE8. The problem first manifested itself as a javascript "client
out of memory" error while using Outlook Web Access (OWA) but it seemed like randomly
we'd have javascript errors while navigating webpages.
&lt;/p&gt;
&lt;p&gt;
Our workaround was to switch over to Google Chrome but then you start finding all
the things that don't work with that so we just wanted to get this figured out.
&lt;/p&gt;
&lt;p&gt;
We ended up working microsoft support on this one and long story short, it looks like
one of our development tools is overwriting one of the IE classes. They had us re-register
a couple classes and now it's working awesome. Here's the registery changes required...
&lt;/p&gt;
&lt;p&gt;
[HKEY_CLASSES_ROOT\Interface\{79EAC9C5-BAF9-11CE-8C82-00AA004BA90B}]&lt;br&gt;
@="IHlinkFrame"&lt;br&gt;
&lt;br&gt;
[HKEY_CLASSES_ROOT\Interface\{79EAC9C5-BAF9-11CE-8C82-00AA004BA90B}\NumMethods]&lt;br&gt;
@="8"&lt;br&gt;
&lt;br&gt;
[HKEY_CLASSES_ROOT\Interface\{79EAC9C5-BAF9-11CE-8C82-00AA004BA90B}\ProxyStubClsid32]&lt;br&gt;
@="{A4A1A128-768F-41E0-BF75-E4FDDD701CBA}"&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=470370c8-d4fa-48a7-b4df-5298685d68a7" /&gt;</description>
      <comments>http://www.bradleysblog.net/Blog/CommentView,guid,470370c8-d4fa-48a7-b4df-5298685d68a7.aspx</comments>
      <category>Technical</category>
    </item>
    <item>
      <trackback:ping>http://www.bradleysblog.net/Blog/Trackback.aspx?guid=a7eaa710-40b1-4d69-89de-fb75373851c3</trackback:ping>
      <pingback:server>http://www.bradleysblog.net/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.bradleysblog.net/Blog/PermaLink,guid,a7eaa710-40b1-4d69-89de-fb75373851c3.aspx</pingback:target>
      <dc:creator>chris.bradley</dc:creator>
      <wfw:comment>http://www.bradleysblog.net/Blog/CommentView,guid,a7eaa710-40b1-4d69-89de-fb75373851c3.aspx</wfw:comment>
      <wfw:commentRss>http://www.bradleysblog.net/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=a7eaa710-40b1-4d69-89de-fb75373851c3</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Some days it's amazing the types of things you get involved in... We've been
fighting some network issues on our VMWare box for the last couple monthes. Everything
on the VMWare community kept referencing Tcp Segment Offloading or TsoEnable. After
screwing around with this for a couple hours I got back to an idea someone else at
work had regarding the actual VMWare system configuration.
</p>
        <p>
Turns out the nic cards in VMWare were by default configured to only run at 100 mbps
instead of 1000mbps. You can re-configure these without even turning off the virtual
servers! Good thinking Andy! Here's a screen snap from the vmware management console
and our resulting performance gain.
</p>
        <p>
          <img src="http://www.bradleysblog.net/Blog/content/binary/vmware-nic-config.png" border="0" />
        </p>
        <img src="http://www.bradleysblog.net/Blog/content/binary/vmware-iperf-results.png" border="0" />
        <img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=a7eaa710-40b1-4d69-89de-fb75373851c3" />
      </body>
      <title>VMWare - Slow Network Performance</title>
      <guid isPermaLink="false">http://www.bradleysblog.net/Blog/PermaLink,guid,a7eaa710-40b1-4d69-89de-fb75373851c3.aspx</guid>
      <link>http://www.bradleysblog.net/Blog/2009/09/09/VMWareSlowNetworkPerformance.aspx</link>
      <pubDate>Wed, 09 Sep 2009 04:04:12 GMT</pubDate>
      <description>&lt;p&gt;
Some days it's amazing&amp;nbsp;the types of things you get involved in... We've been
fighting some network issues on our VMWare box for the last couple monthes. Everything
on the VMWare community kept referencing Tcp Segment Offloading or TsoEnable. After
screwing around with this for a couple hours I got back to an idea someone else at
work had regarding the actual VMWare system configuration.
&lt;/p&gt;
&lt;p&gt;
Turns out the nic cards in VMWare were by default configured to only run at 100 mbps
instead of 1000mbps. You can re-configure these without even turning off the virtual
servers! Good thinking Andy! Here's a screen snap from the vmware management console
and our resulting performance gain.
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.bradleysblog.net/Blog/content/binary/vmware-nic-config.png" border=0&gt;
&lt;/p&gt;
&lt;img src="http://www.bradleysblog.net/Blog/content/binary/vmware-iperf-results.png" border=0&gt;&lt;img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=a7eaa710-40b1-4d69-89de-fb75373851c3" /&gt;</description>
      <comments>http://www.bradleysblog.net/Blog/CommentView,guid,a7eaa710-40b1-4d69-89de-fb75373851c3.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.bradleysblog.net/Blog/Trackback.aspx?guid=17ceec3d-04bf-4a83-9505-64242c05ae9b</trackback:ping>
      <pingback:server>http://www.bradleysblog.net/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.bradleysblog.net/Blog/PermaLink,guid,17ceec3d-04bf-4a83-9505-64242c05ae9b.aspx</pingback:target>
      <dc:creator>chris.bradley</dc:creator>
      <wfw:comment>http://www.bradleysblog.net/Blog/CommentView,guid,17ceec3d-04bf-4a83-9505-64242c05ae9b.aspx</wfw:comment>
      <wfw:commentRss>http://www.bradleysblog.net/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=17ceec3d-04bf-4a83-9505-64242c05ae9b</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
We've had some problems with the Binding Source component in our Windows Forms development
and I wanted to jot down a note on here in case anyone else comes across this.
</p>
        <p>
The problem we were having was an IDE runtime error which looks like a NullReferenceException,
the specific message says "Object reference not set to an instance of an object".
</p>
        <p>
Apparently this has something to do with the .datasource files that are auto-generated
by visual studio for holding "default" values. You can remove these from the My Project
folder and then the error goes away. Not sure why these are even required since you
can still build without them.
</p>
        <img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=17ceec3d-04bf-4a83-9505-64242c05ae9b" />
      </body>
      <title>BindingSource "Object reference not set to an instance of an object"</title>
      <guid isPermaLink="false">http://www.bradleysblog.net/Blog/PermaLink,guid,17ceec3d-04bf-4a83-9505-64242c05ae9b.aspx</guid>
      <link>http://www.bradleysblog.net/Blog/2009/08/14/BindingSourceObjectReferenceNotSetToAnInstanceOfAnObject.aspx</link>
      <pubDate>Fri, 14 Aug 2009 15:35:42 GMT</pubDate>
      <description>&lt;p&gt;
We've had some problems with the Binding Source component in our Windows Forms development
and I wanted to jot down a note on here in case anyone else comes across this.
&lt;/p&gt;
&lt;p&gt;
The problem we were having was an IDE runtime error which looks like a NullReferenceException,
the specific message says "Object reference not set to an instance of an object".
&lt;/p&gt;
&lt;p&gt;
Apparently this has something to do with the .datasource files that are auto-generated
by visual studio for holding "default" values. You can remove these from the My Project
folder and then the error goes away. Not sure why these are even required since you
can still build without them.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=17ceec3d-04bf-4a83-9505-64242c05ae9b" /&gt;</description>
      <comments>http://www.bradleysblog.net/Blog/CommentView,guid,17ceec3d-04bf-4a83-9505-64242c05ae9b.aspx</comments>
      <category>Technical</category>
    </item>
    <item>
      <trackback:ping>http://www.bradleysblog.net/Blog/Trackback.aspx?guid=7d7395a5-00d1-43b0-8976-9f56616969aa</trackback:ping>
      <pingback:server>http://www.bradleysblog.net/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.bradleysblog.net/Blog/PermaLink,guid,7d7395a5-00d1-43b0-8976-9f56616969aa.aspx</pingback:target>
      <dc:creator>chris.bradley</dc:creator>
      <wfw:comment>http://www.bradleysblog.net/Blog/CommentView,guid,7d7395a5-00d1-43b0-8976-9f56616969aa.aspx</wfw:comment>
      <wfw:commentRss>http://www.bradleysblog.net/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=7d7395a5-00d1-43b0-8976-9f56616969aa</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
We've had some problems on our Windows 2008 servers integrating with a third party
web service. The exceptions we got were...
</p>
        <p>
WebException: an unexpected error occured on a send.
</p>
        <p>
IOException: authentication failed because the remote party has closed the transport
stream.
</p>
        <p>
These errors wouldn't occur on Windows 2000 or 2003 boxes but popped up on all our
2008 installs. Turns out security is managed a little differently on 2008 and if the
partner website is really strict with authentication you need to override the authentication
mechanism.
</p>
        <p>
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
</p>
        <p>
It's only line of code but it's worth understanding the back story a little better.
Here's the blog entry that pointed me in the right direction.
</p>
        <p>
http://blogs.msdn.com/carloc/archive/2007/02/13/webclient-2-0-class-not-working-under-win2000-with-https.aspx
</p>
        <img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=7d7395a5-00d1-43b0-8976-9f56616969aa" />
      </body>
      <title>WebClient.DownloadFile</title>
      <guid isPermaLink="false">http://www.bradleysblog.net/Blog/PermaLink,guid,7d7395a5-00d1-43b0-8976-9f56616969aa.aspx</guid>
      <link>http://www.bradleysblog.net/Blog/2009/07/16/WebClientDownloadFile.aspx</link>
      <pubDate>Thu, 16 Jul 2009 17:59:23 GMT</pubDate>
      <description>&lt;p&gt;
We've had some problems on our Windows 2008 servers integrating with a third party
web service. The exceptions we got were...
&lt;/p&gt;
&lt;p&gt;
WebException: an unexpected error occured on a send.
&lt;/p&gt;
&lt;p&gt;
IOException: authentication failed because the remote party has closed the transport
stream.
&lt;/p&gt;
&lt;p&gt;
These errors wouldn't occur on Windows 2000 or 2003 boxes but popped up on all our
2008 installs. Turns out security is managed a little differently on 2008 and if the
partner website is really strict with authentication you need to override the authentication
mechanism.
&lt;/p&gt;
&lt;p&gt;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
&lt;/p&gt;
&lt;p&gt;
It's only line of code but it's worth understanding the back story a little better.
Here's the blog entry that pointed me in the right direction.
&lt;/p&gt;
&lt;p&gt;
http://blogs.msdn.com/carloc/archive/2007/02/13/webclient-2-0-class-not-working-under-win2000-with-https.aspx
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=7d7395a5-00d1-43b0-8976-9f56616969aa" /&gt;</description>
      <comments>http://www.bradleysblog.net/Blog/CommentView,guid,7d7395a5-00d1-43b0-8976-9f56616969aa.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.bradleysblog.net/Blog/Trackback.aspx?guid=64883720-4895-4c43-a99e-66e98b0e2e3a</trackback:ping>
      <pingback:server>http://www.bradleysblog.net/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.bradleysblog.net/Blog/PermaLink,guid,64883720-4895-4c43-a99e-66e98b0e2e3a.aspx</pingback:target>
      <dc:creator>chris.bradley</dc:creator>
      <wfw:comment>http://www.bradleysblog.net/Blog/CommentView,guid,64883720-4895-4c43-a99e-66e98b0e2e3a.aspx</wfw:comment>
      <wfw:commentRss>http://www.bradleysblog.net/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=64883720-4895-4c43-a99e-66e98b0e2e3a</wfw:commentRss>
      <title>Active Reports Viewer IndexOutOfRangeException</title>
      <guid isPermaLink="false">http://www.bradleysblog.net/Blog/PermaLink,guid,64883720-4895-4c43-a99e-66e98b0e2e3a.aspx</guid>
      <link>http://www.bradleysblog.net/Blog/2009/05/07/ActiveReportsViewerIndexOutOfRangeException.aspx</link>
      <pubDate>Thu, 07 May 2009 02:10:29 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;span lang=EN-US style="mso-ansi-language: EN-US"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;We’ve
been fighting an intermittent error with our report viewer for the last couple years
that’s been just terrible to track down and I think we finally made some progress
today. We use a reporting tool called Data Dynamics Active Reports to generate our
Screen and Paper reports. Their tool is basically a set of Dot Net assemblies that
allow you to design and code a component called an Active Report.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;font color=#000000&gt;&lt;span lang=EN-US style="mso-ansi-language: EN-US"&gt;&lt;font face=Calibri size=3&gt;At
runtime, you execute this Active Report and then pass it into another component called
an Active Report Viewer for displaying to the user. We found occasionally our users
would get stuck in an infinite loop of error messages while displaying a report. Exceptions
would pop up looking like this…&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;&lt;/span&gt;&lt;span lang=EN-US style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Segoe UI','sans-serif'; mso-ansi-language: EN-US"&gt;(IndexOutOfRangeException)
Index was outside the bounds of the array.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"&gt;
&lt;span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 'Segoe UI','sans-serif'; mso-ansi-language: EN-US"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;&lt;span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 'Segoe UI','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;font color=#000000&gt;&amp;nbsp;
at DataDynamics.ActiveReports.Viewer.-0011.-3cbd()&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"&gt;
&lt;span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 'Segoe UI','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;
at DataDynamics.ActiveReports.Viewer.-dabf.-31a1()&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;span lang=EN-US style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Segoe UI','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;
at DataDynamics.ActiveReports.Viewer.-b212.-afcd()&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;span lang=EN-US style="mso-bidi-font-family: 'Segoe UI'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;We
could never recreate this on demand, but probably five times a month we would get
a hundred error messages coming in from a client site like this. Eventually the client
would give up pressing “OK” on our error handler, and kill the process.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;span lang=EN-US style="mso-bidi-font-family: 'Segoe UI'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;When
we’ve tried to troubleshoot this in the past it’s been extremely difficult because
Data Dynamics obfuscates their code so it can’t be decompiled. Obfuscation basically
takes design-time code, and mixes it up so that it’s unreadable, hence the funky function
names above. Unfortunately this gives you no sense of what’s actually happening in
their app.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;span lang=EN-US style="mso-bidi-font-family: 'Segoe UI'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;font face=Calibri color=#000000 size=3&gt;A
little bit of digging on their support forums today did find a link to a similar issue
by another user - &lt;/font&gt;&lt;a href="http://www.datadynamics.com/forums/85506/ShowPost.aspx"&gt;&lt;font face=Calibri size=3&gt;http://www.datadynamics.com/forums/85506/ShowPost.aspx&lt;/font&gt;&lt;/a&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;span lang=EN-US style="mso-bidi-font-family: 'Segoe UI'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;Basically
what they’d found was that in a Terminal Services environment, their users would click
their “Print” button multiple times – the old adage, keep pressing the button until
something happens. What this causes in some instances is for the second “click” to
get handled by the newly created Active Report Viewer, even though it’s just in the
process of being displayed. Now, if the Viewer is in a funny spot, it can try and
interact with this click event while loading the document – that’s what seems to cause
the issue.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;span lang=EN-US style="mso-bidi-font-family: 'Segoe UI'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;Once
we had a sense of what was causing the issue, it’s pretty simple to disable the ReportViewer
until the report has generated its first page and sure enough this causes the issue
to go away.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.bradleysblog.net/Blog/aggbug.ashx?id=64883720-4895-4c43-a99e-66e98b0e2e3a" /&gt;</description>
      <comments>http://www.bradleysblog.net/Blog/CommentView,guid,64883720-4895-4c43-a99e-66e98b0e2e3a.aspx</comments>
      <category>Technical</category>
    </item>
  </channel>
</rss>
