<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Mr. .NET &#187; .NET 1.x</title>
	<atom:link href="http://mrdotnet.wordpress.com/category/technology/net-1x/feed/" rel="self" type="application/rss+xml" />
	<link>http://mrdotnet.wordpress.com</link>
	<description>Thoughts from a Product Manager...Geek...Gamer</description>
	<lastBuildDate>Wed, 18 Nov 2009 06:00:05 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='mrdotnet.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/e680e43f4a92d24332874dabdea8c44e?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Mr. .NET &#187; .NET 1.x</title>
		<link>http://mrdotnet.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mrdotnet.wordpress.com/osd.xml" title="Mr. .NET" />
		<item>
		<title>When Sleep can be bad</title>
		<link>http://mrdotnet.wordpress.com/2006/08/29/when-sleep-can-be-bad/</link>
		<comments>http://mrdotnet.wordpress.com/2006/08/29/when-sleep-can-be-bad/#comments</comments>
		<pubDate>Tue, 29 Aug 2006 17:40:35 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[.NET 1.x]]></category>
		<category><![CDATA[.NET 2.0]]></category>

		<guid isPermaLink="false">http://mrdotnet.wordpress.com/2006/08/29/when-sleep-can-be-bad/</guid>
		<description><![CDATA[Thread.Sleep(0); that is.
Joe Duffy explains why Thread.Sleep(1) is better than Thread.Sleep(0).
Thanks to Jason for the heads up.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=392&subd=mrdotnet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><code>Thread.Sleep(0);</code> that is.</p>
<p>Joe Duffy explains why <a href="http://www.bluebytesoftware.com/blog/PermaLink,guid,1c013d42-c983-4102-9233-ca54b8f3d1a1.aspx">Thread.Sleep(1) is better than Thread.Sleep(0)</a>.</p>
<p>Thanks to <a href="http://yoopergeek.blogspot.com/">Jason</a> for the heads up.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mrdotnet.wordpress.com/392/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mrdotnet.wordpress.com/392/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrdotnet.wordpress.com/392/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrdotnet.wordpress.com/392/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrdotnet.wordpress.com/392/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrdotnet.wordpress.com/392/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrdotnet.wordpress.com/392/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrdotnet.wordpress.com/392/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrdotnet.wordpress.com/392/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrdotnet.wordpress.com/392/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrdotnet.wordpress.com/392/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrdotnet.wordpress.com/392/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=392&subd=mrdotnet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mrdotnet.wordpress.com/2006/08/29/when-sleep-can-be-bad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mrdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>ToolboxItem</title>
		<link>http://mrdotnet.wordpress.com/2006/03/09/toolboxitem/</link>
		<comments>http://mrdotnet.wordpress.com/2006/03/09/toolboxitem/#comments</comments>
		<pubDate>Thu, 09 Mar 2006 16:54:41 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[.NET 1.x]]></category>
		<category><![CDATA[.NET 2.0]]></category>

		<guid isPermaLink="false">http://mrdotnet.wordpress.com/2006/03/09/toolboxitem/</guid>
		<description><![CDATA[Over on the develomentor advanced-dotnet mailing list Frans Bouma recently posted an answer to the question:  How do you perform an operation the first time a control is added to the form.
Considering the Design time stuff is something I need to learn more about I thought I&#8217;d post his answer here in case I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=371&subd=mrdotnet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Over on the develomentor advanced-dotnet mailing list Frans Bouma recently posted an answer to the question:  How do you perform an operation the first time a control is added to the form.</p>
<p>Considering the Design time stuff is something I need to learn more about I thought I&#8217;d post his answer here in case I need to do something like that in the future (not to mention help whoever may read this)</p>
<blockquote><p>Though I&#8217;d use a Toolbox item<br />
Create a simple class derived from System.Drawing.Design.ToolboxItem and add it to your control via the ToolboxItemAttribute, which takes a string or a typeof definition.</p>
<p>In your ToolboxItem class, you override CreateComponentsCore and you there create your control and also do your things you want to execute when the control is placed onto the form.</p></blockquote>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mrdotnet.wordpress.com/371/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mrdotnet.wordpress.com/371/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrdotnet.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrdotnet.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrdotnet.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrdotnet.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrdotnet.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrdotnet.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrdotnet.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrdotnet.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrdotnet.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrdotnet.wordpress.com/371/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=371&subd=mrdotnet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mrdotnet.wordpress.com/2006/03/09/toolboxitem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mrdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Rich menus are done!</title>
		<link>http://mrdotnet.wordpress.com/2006/02/20/rich-menus-are-done/</link>
		<comments>http://mrdotnet.wordpress.com/2006/02/20/rich-menus-are-done/#comments</comments>
		<pubDate>Mon, 20 Feb 2006 06:12:33 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[.NET 1.x]]></category>
		<category><![CDATA[BetterMenu]]></category>

		<guid isPermaLink="false">http://mrdotnet.wordpress.com/2006/02/20/rich-menus-are-done/</guid>
		<description><![CDATA[The menus are done!

I&#8217;m not quite ready to release this code yet though.  I have one major issue I need to take into account, how do I dynamically size up what the maximum width of the rich menu should be so that it also takes into account the DPI settings on the users PC. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=361&subd=mrdotnet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The menus are done!</p>
<p><img src="http://www.misterdotnet.com/blog/wp-content/uploads/richmenu_2006-02-20.jpg" height="358" alt="Text Separators and Rich Menus in an SDI application" /></p>
<p>I&#8217;m not quite ready to release this code yet though.  I have one major issue I need to take into account, how do I dynamically size up what the maximum width of the rich menu should be so that it also takes into account the DPI settings on the users PC.  Much like how controls get resized depending on the DPI setting, so too should the maximum width of the rich menu.  But that comes tomorrow.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mrdotnet.wordpress.com/361/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mrdotnet.wordpress.com/361/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrdotnet.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrdotnet.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrdotnet.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrdotnet.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrdotnet.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrdotnet.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrdotnet.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrdotnet.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrdotnet.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrdotnet.wordpress.com/361/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=361&subd=mrdotnet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mrdotnet.wordpress.com/2006/02/20/rich-menus-are-done/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mrdotnet</media:title>
		</media:content>

		<media:content url="http://www.misterdotnet.com/blog/wp-content/uploads/richmenu_2006-02-20.jpg" medium="image">
			<media:title type="html">Text Separators and Rich Menus in an SDI application</media:title>
		</media:content>
	</item>
		<item>
		<title>Rich menu preview</title>
		<link>http://mrdotnet.wordpress.com/2006/02/16/rich-menu-preview/</link>
		<comments>http://mrdotnet.wordpress.com/2006/02/16/rich-menu-preview/#comments</comments>
		<pubDate>Thu, 16 Feb 2006 07:40:25 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[.NET 1.x]]></category>
		<category><![CDATA[BetterMenu]]></category>

		<guid isPermaLink="false">http://mrdotnet.wordpress.com/2006/02/16/rich-menu-preview/</guid>
		<description><![CDATA[I&#8217;m going to hate myself in the morning, but I have almost got rich menu support fully added to the normal menu drawer.
My only quandry left is how to determine the optimum default maximum width for the description area?  How should I scale this value so that a user with large fonts set doesn&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=359&subd=mrdotnet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m going to hate myself in the morning, but I have almost got rich menu support fully added to the normal menu drawer.</p>
<p>My only quandry left is how to determine the optimum default maximum width for the description area?  How should I scale this value so that a user with large fonts set doesn&#8217;t see an incredibly tiny description area.</p>
<p>I&#8217;m also not sure why there is a blank space following the Copy menu item.  I&#8217;m far too tired to actually debug it right now, but I wanted to get this up tonight.</p>
<p><img src="http://www.misterdotnet.com/blog/wp-content/uploads/rich_menu_2006-02-15.jpg" width="352" height="353" alt="Rich menu support partially added" /></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mrdotnet.wordpress.com/359/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mrdotnet.wordpress.com/359/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrdotnet.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrdotnet.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrdotnet.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrdotnet.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrdotnet.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrdotnet.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrdotnet.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrdotnet.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrdotnet.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrdotnet.wordpress.com/359/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=359&subd=mrdotnet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mrdotnet.wordpress.com/2006/02/16/rich-menu-preview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mrdotnet</media:title>
		</media:content>

		<media:content url="http://www.misterdotnet.com/blog/wp-content/uploads/rich_menu_2006-02-15.jpg" medium="image">
			<media:title type="html">Rich menu support partially added</media:title>
		</media:content>
	</item>
		<item>
		<title>Half way there</title>
		<link>http://mrdotnet.wordpress.com/2006/02/15/half-way-there/</link>
		<comments>http://mrdotnet.wordpress.com/2006/02/15/half-way-there/#comments</comments>
		<pubDate>Wed, 15 Feb 2006 05:28:25 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[.NET 1.x]]></category>
		<category><![CDATA[BetterMenu]]></category>

		<guid isPermaLink="false">http://mrdotnet.wordpress.com/2006/02/15/half-way-there/</guid>
		<description><![CDATA[I&#8217;ve got the textual separator almost completely implemented in both Normal and Office XP menu styles.
The highlight color isn&#8217;t 100% right, only off by a few RGB values though.  Same with the separator line running underneath it.  I can&#8217;t seem to figure out the text color for the separator.  SystemColors.Highlight isn&#8217;t dark [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=358&subd=mrdotnet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve got the textual separator almost completely implemented in both Normal and Office XP menu styles.</p>
<p>The highlight color isn&#8217;t 100% right, only off by a few RGB values though.  Same with the separator line running underneath it.  I can&#8217;t seem to figure out the text color for the separator.  SystemColors.Highlight isn&#8217;t dark enough, and I can&#8217;t seem to find an alpha value for black text over the light blue highlight.  As much as I hate the idea maybe I&#8217;ll need to draw black text then overlay that with a transparent SystemColors.Highlight.</p>
<p>Here are my results so far though:</p>
<p><img src="http://www.misterdotnet.com/blog/wp-content/uploads/textual_separator.jpg" width="352" height="353" alt="The current state of the textual separator" /></p>
<p>For those that don&#8217;t want to bother reading the 4 page article I wrote about it, BetterMenu (aka MenuExtenderComponent) is a .NET windows forms component that adds menu images, office xp style menus, MDI menu and MDI merged menu support to the regular .NET Menu controls.  This project is focused at .NET 1.1 applications, but should work fine in a .NET 2.0 application.  I recommend using the MenuStrip components if you are using .NET 2.0 though; they offer features that aren&#8217;t available in this component (such as drawing the entire length of the main menu bar, no 1px gap around the entire menu, etc).</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mrdotnet.wordpress.com/358/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mrdotnet.wordpress.com/358/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrdotnet.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrdotnet.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrdotnet.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrdotnet.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrdotnet.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrdotnet.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrdotnet.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrdotnet.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrdotnet.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrdotnet.wordpress.com/358/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=358&subd=mrdotnet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mrdotnet.wordpress.com/2006/02/15/half-way-there/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mrdotnet</media:title>
		</media:content>

		<media:content url="http://www.misterdotnet.com/blog/wp-content/uploads/textual_separator.jpg" medium="image">
			<media:title type="html">The current state of the textual separator</media:title>
		</media:content>
	</item>
		<item>
		<title>VS.NET 2003 doesn&#8217;t like me</title>
		<link>http://mrdotnet.wordpress.com/2006/02/14/vsnet-2003-doesnt-like-me/</link>
		<comments>http://mrdotnet.wordpress.com/2006/02/14/vsnet-2003-doesnt-like-me/#comments</comments>
		<pubDate>Tue, 14 Feb 2006 13:43:06 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[.NET 1.x]]></category>

		<guid isPermaLink="false">http://mrdotnet.wordpress.com/2006/02/14/vsnet-2003-doesnt-like-me/</guid>
		<description><![CDATA[I don&#8217;t know why, but it took 5-7 restarts of the IDE to finally get all of the name changes into BetterMenu.  I would work on it for a few minutes and then it would refuse to display any dialog but the Find/Replace one.  It wouldn&#8217;t even show Find/Replace in Files which is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=356&subd=mrdotnet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I don&#8217;t know why, but it took 5-7 restarts of the IDE to finally get all of the name changes into BetterMenu.  I would work on it for a few minutes and then it would refuse to display any dialog but the Find/Replace one.  It wouldn&#8217;t even show Find/Replace in Files which is what I wanted.  Not to mention weird compile errors such as trying to build my demo projects when I told it to build the component and of course it errored, the component the project referenced hadn&#8217;t been build yet.</p>
<p>If this keeps up I may have to do a reinstall of VS.NET 2003 and VS2005.</p>
<p>Anyway, off to work with me!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mrdotnet.wordpress.com/356/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mrdotnet.wordpress.com/356/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrdotnet.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrdotnet.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrdotnet.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrdotnet.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrdotnet.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrdotnet.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrdotnet.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrdotnet.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrdotnet.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrdotnet.wordpress.com/356/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=356&subd=mrdotnet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mrdotnet.wordpress.com/2006/02/14/vsnet-2003-doesnt-like-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mrdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Returning to an old project</title>
		<link>http://mrdotnet.wordpress.com/2006/02/13/returning-to-an-old-project/</link>
		<comments>http://mrdotnet.wordpress.com/2006/02/13/returning-to-an-old-project/#comments</comments>
		<pubDate>Tue, 14 Feb 2006 01:04:24 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[.NET 1.x]]></category>
		<category><![CDATA[BetterMenu]]></category>

		<guid isPermaLink="false">http://mrdotnet.wordpress.com/2006/02/13/returning-to-an-old-project/</guid>
		<description><![CDATA[Its been a while since I&#8217;ve talked about programming other than work or the syntax highlighter.  Recent posts over on Jensen Harris&#8217; Office User Interface blog have got me itching to add new features to an old project of mine the MenuExtenderComponent, soon to be named BetterMenu.
His recent posts about the richer menus in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=355&subd=mrdotnet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Its been a while since I&#8217;ve talked about programming other than work or the syntax highlighter.  Recent posts over on <a href="http://blogs.msdn.com/jensenh/default.aspx">Jensen Harris&#8217; Office User Interface blog</a> have got me itching to add new features to an old project of mine the <a href="http://www.misterdotnet.com/blog/?p=182">MenuExtenderComponent</a>, soon to be named BetterMenu.</p>
<p>His recent posts about the richer menus in Office 12 have made me want to implement some of those features into <strike>MenuC</strike> BetterMenu.  Namely the <a href="http://blogs.msdn.com/jensenh/archive/2006/01/30/519335.aspx">Textual Separators</a> and <a href="http://blogs.msdn.com/jensenh/archive/2006/02/06/525704.aspx">Rich Menus</a>.  Both would be easy to implement, I just need to dig out the code, add a couple of properties, and implement a couple methods.  Hopefully I can find my latest version of the code so I don&#8217;t have to go back in and refix bugs I fixed nearly a year ago.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mrdotnet.wordpress.com/355/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mrdotnet.wordpress.com/355/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrdotnet.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrdotnet.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrdotnet.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrdotnet.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrdotnet.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrdotnet.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrdotnet.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrdotnet.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrdotnet.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrdotnet.wordpress.com/355/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=355&subd=mrdotnet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mrdotnet.wordpress.com/2006/02/13/returning-to-an-old-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mrdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>preg_replace_callback in c#</title>
		<link>http://mrdotnet.wordpress.com/2005/09/01/preg_replace_callback-in-c/</link>
		<comments>http://mrdotnet.wordpress.com/2005/09/01/preg_replace_callback-in-c/#comments</comments>
		<pubDate>Thu, 01 Sep 2005 18:36:40 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[.NET 1.x]]></category>
		<category><![CDATA[.NET 2.0]]></category>

		<guid isPermaLink="false">http://mrdotnet.wordpress.com/2005/09/01/preg_replace_callback-in-c/</guid>
		<description><![CDATA[Sometime today someone hit my blog after searching for &#8220;preg_replace_callback in c#&#8221;, this seems to be something useful to post about so here we go.  And while this person is familiar with doing this stuff in PHP this post is for everyone so I&#8217;ll explain it from the ground up.  If you are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=330&subd=mrdotnet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Sometime today someone hit my blog after searching for &#8220;preg_replace_callback in c#&#8221;, this seems to be something useful to post about so here we go.  And while this person is familiar with doing this stuff in PHP this post is for everyone so I&#8217;ll explain it from the ground up.  If you are already familiar with preg_replace_callback in PHP then you can just look at the next line to see the key that unlocks the info in MSDN.</p>
<p>The magic of doing programmatic replacement of text in a .NET regular expression is handled by the <code>MatchEvaluator</code> delegate.</p>
<pre>public delegate string MatchEvaluator( Match match );</pre>
<p>When you write your Regex and use it in one of the Replace methods; every time your pattern has a match, that Match gets sent through the MatchEvaluator you specify.  This delegate can point to any one of your methods that matches the right signature; and with it you can choose what to replace the found pattern with however you wish to.</p>
<p><span id="more-330"></span></p>
<p>For example:  If you have the pattern <code>\w+</code> it will match every series of word characters.  Now we want to capitalize the first letter of every word; so we need to run some code to do that.  This isn&#8217;t hard to do; but it requires more processing than I think Regex gives you by itself.</p>
<pre>string CapitalizeWord( Match match )
{
  StringBuilder sb = new StringBuilder( match.Value );
  sb[0] = Char.ToUpper(sb[0]);  // Take the first letter, capitalize it, and set it back to the first letter.

  return sb.ToString();
}</pre>
<p>Now combining that with what we learned above we can construct the proper use of the Regex object to do this.</p>
<pre>using System;
using System.Text;
using System.Text.RegularExpressions;

class Program
{
  [STAThread]
  static void Main(string[] args)
  {
    string input = "";

    while( (input = Console.ReadLine()) != "" )
    {
      MatchEvaluator myMatchEvaluator =
        new MatchEvaluator( CapitalizeWord );

      // the @ means \ doesn't escape anymore
      Regex re = new Regex( @"\w+" );
      string output = re.Replace( input, myMatchEvaluator );

      Console.WriteLine( "{0}", output );
    }
  }

  static string CapitalizeWord( Match match )
  {
    StringBuilder sb = new StringBuilder( match.Value );

    // Take the first letter, capitalize it,
    // and set it back to the first letter.
    sb[0] = Char.ToUpper(sb[0]);  

    return sb.ToString();
  }
}</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mrdotnet.wordpress.com/330/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mrdotnet.wordpress.com/330/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrdotnet.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrdotnet.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrdotnet.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrdotnet.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrdotnet.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrdotnet.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrdotnet.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrdotnet.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrdotnet.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrdotnet.wordpress.com/330/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=330&subd=mrdotnet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mrdotnet.wordpress.com/2005/09/01/preg_replace_callback-in-c/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mrdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>SyntaxHighlighter for .NET problems fixed</title>
		<link>http://mrdotnet.wordpress.com/2005/07/13/syntaxhighlighter-for-net-problems-fixed/</link>
		<comments>http://mrdotnet.wordpress.com/2005/07/13/syntaxhighlighter-for-net-problems-fixed/#comments</comments>
		<pubDate>Wed, 13 Jul 2005 10:56:51 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[.NET 1.x]]></category>

		<guid isPermaLink="false">http://mrdotnet.wordpress.com/2005/07/13/syntaxhighlighter-for-net-problems-fixed/</guid>
		<description><![CDATA[Update:  I should have proofread this first&#8230;my original intent was to just post about the problems; but after writing about them I decided to pack up a new release but I didn&#8217;t change the text to acknowledge that.
Looking back at the previous post I noticed I wasn&#8217;t very clear in how to use it. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=323&subd=mrdotnet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>Update</strong>:  I should have proofread this first&#8230;my original intent was to just post about the problems; but after writing about them I decided to pack up a new release but I didn&#8217;t change the text to acknowledge that.</p>
<p>Looking back at the previous post I noticed I wasn&#8217;t very clear in how to use it.  And I&#8217;ve also squashed some killer bugs with a ton of help from <a href="http://www.voidnish.com">Nish</a>.</p>
<p>In particular, it would ignore the language specification in a pre block unless the language is in quotes (&#8220;&#8221;); breaking compatibility with the PHP version.  There were also a couple bugs dealing with how comments were handled; one was a simple copy/paste error on my part where instead of looking for block comments it looked for line comments again.  The other is more sinister in that the sorting routines between PHP and .NET differ enough that the same same sorting routine will work fine in PHP but cause an infinite loop in .NET.</p>
<p>Both are now fixed.</p>
<p>The demo application has been cleaned up a bit; and the base code is now more forgiving of multiple language registrations and handling unregistered languages.</p>
<p>To use the demo application put the files you want to highlight into a directory with a &#8220;.src&#8221; extension.  Run the ConsoleDemo.exe program with the directory name as the only paramter (or set your current directory to the same place the source files are and run it).  The highlighted versions will be written out with the same name, but with a &#8220;.html&#8221; extension.</p>
<p>Once its done it will spit out some very basic stats: the number of bytes output, total time taken, and average time taken.</p>
<p>Download links follow:<br />
<a href="http://www.misterdotnet.com/downloads/SyntaxHighlighter/SyntaxHighlighter.zip">SyntaxHighlighter.zip</a> &#8211; Demo application (10KB)<br />
<a href="http://www.misterdotnet.com/downloads/SyntaxHighlighter/SyntaxHighlighter_src.zip">SyntaxHighlighter_src.zip</a> &#8211; Source code (15KB)</p>
<p>Nish is starting to use this on his regular website now so as long as it doesn&#8217;t completely thrash his site my next goal is going to be the ASP.NET control.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mrdotnet.wordpress.com/323/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mrdotnet.wordpress.com/323/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrdotnet.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrdotnet.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrdotnet.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrdotnet.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrdotnet.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrdotnet.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrdotnet.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrdotnet.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrdotnet.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrdotnet.wordpress.com/323/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=323&subd=mrdotnet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mrdotnet.wordpress.com/2005/07/13/syntaxhighlighter-for-net-problems-fixed/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mrdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>SyntaxHighlighter for .NET</title>
		<link>http://mrdotnet.wordpress.com/2005/07/10/syntaxhighlighter-for-net/</link>
		<comments>http://mrdotnet.wordpress.com/2005/07/10/syntaxhighlighter-for-net/#comments</comments>
		<pubDate>Sun, 10 Jul 2005 13:31:20 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[.NET 1.x]]></category>

		<guid isPermaLink="false">http://mrdotnet.wordpress.com/2005/07/10/syntaxhighlighter-for-net/</guid>
		<description><![CDATA[After some prodding from Nish I ported the SyntaxHighlighter in use here and on his blog over to .NET.  It spits out HTML so it is really meant to be used from ASP.NET, but I don&#8217;t have the true ASP.NET control written yet.  For now you just have to settle for calling a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=322&subd=mrdotnet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>After some prodding from <a href="http://www.voidnish.com">Nish</a> I ported the SyntaxHighlighter in use here and on <a href="http://blog.voidnish.com/">his blog</a> over to .NET.  It spits out HTML so it is really meant to be used from ASP.NET, but I don&#8217;t have the true ASP.NET control written yet.  For now you just have to settle for calling a few methods manually.</p>
<p>Since this one is mainly meant to be used with articles and not blog-like text it doesn&#8217;t do any fixing up of the text before processing it.</p>
<p>This is a <strong>very</strong> basic port; with only the &#8220;plain text&#8221; and &#8220;C#&#8221; languages added.  Source code is included so anyone can modify or add their own languages.</p>
<p>Download links, features, bugs, coming features, and sample code follow the break.</p>
<p><span id="more-322"></span></p>
<p>Known problems:
<ul>
<li>If &#8220;show line numbers&#8221; is turned on and the pre block ends with the &lt;/pre&gt;&gt; on a line by itself, the blank line will get its own line numbers.  <strong>Workaround:</strong>  Don&#8217;t end your pre blocks on a line by themselves.</li>
</ul>
<p>Upcoming features:
<ul>
<li>ASP.NET control for drag &amp; drop goodness</li>
<li>More languages ported</li>
<li>Language initialization handled in config files</li>
<li><em>Possibly</em> a request handler added for no-hassle highlighting</li>
<li>More code comments and samples</li>
</ul>
<p>Current features:
<ul>
<li>OO design</li>
<li>Optimized handling of multiple snippets in one request</li>
<li>Highlights:
<ul>
<li>Line comments</li>
<li>Block comments</li>
<li>Strings</li>
<li>Keywords</li>
<li>Numbers</li>
</ul>
</li>
<li>Multiple highlighting schemes possible.<br />
<blockquote>For example I currently have implemented a GenericLanguageDefinition class which will handle C like languages.  But this highlighter is going to work poorly when dealing with HTML which would work best by just highlighting tag names.  With the new OO design it is possible to implement this now&#8230;.Just not by me, right now</p></blockquote>
</li>
</ul>
<p>I&#8217;ve been awake since midnight now; with only a few hours of sleep before that so I&#8217;m going to take a nap now.</p>
<p>But first, you may want the links to download it.</p>
<p><a href="http://www.misterdotnet.com/downloads/SyntaxHighlighter/SyntaxHighlighter.zip">SyntaxHighlighter.zip</a> (7Kb) &#8211; Compiled DLL.<br />
<a href="http://www.misterdotnet.com/downloads/SyntaxHighlighter/SyntaxHighlighter.zip">SyntaxHighlighter_src.zip</a> (13Kb) &#8211; Source code</p>
<p>You can look at the ConsoleDemo/Program.cs to see how it can be used in a console app; but the same thing can be done in an ASP.NET application.</p>
<p>To use it on your website all you should need to do is drop the dll in your site&#8217;s bin folder.  Then simply add a few lines of code.</p>
<pre>using MrDotNet.Web.SyntaxHighlighter;
using MrDotNet.Web.SyntaxHighlighter.Languages;

private void Initialize()
{
    LanguageDefinition ld;

    ld = new PlainTextLanguageDefinition();

    //SyntaxHighlighter.RegisterLanguageDefinition( "", ld );
    SyntaxHighlighter.RegisterLanguageDefinition( "text", ld );

    ld = new CSharpLanguageDefinition();
    SyntaxHighlighter.RegisterLanguageDefinition( "", ld );
    SyntaxHighlighter.RegisterLanguageDefinition( "cs", ld );
    SyntaxHighlighter.RegisterLanguageDefinition( "c#", ld );
}</pre>
<p>Call Initialize from within your Page_Load, then where you want to highlight the code:</p>
<pre>string highlightedCode = SyntaxHighlighter.HighlightFile( "c:\\sample.txt" );</pre>
<p>This will return the HTML needed to highlight the code found in C:\sample.txt.  There are also HighlightSnippet and HighlightText methods.  HighlightText will only highlight text found withing &lt;pre&gt; tags, while HighlightSnippet will highlight everything passed in.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mrdotnet.wordpress.com/322/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mrdotnet.wordpress.com/322/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mrdotnet.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mrdotnet.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mrdotnet.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mrdotnet.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mrdotnet.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mrdotnet.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mrdotnet.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mrdotnet.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mrdotnet.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mrdotnet.wordpress.com/322/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mrdotnet.wordpress.com&blog=12763&post=322&subd=mrdotnet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mrdotnet.wordpress.com/2005/07/10/syntaxhighlighter-for-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mrdotnet</media:title>
		</media:content>
	</item>
	</channel>
</rss>