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

<channel>
	<title>GrinGod [dot] Com &#187; .NET</title>
	<atom:link href="http://www.gringod.com/category/programming/vbnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gringod.com</link>
	<description>Randomised nonsense.</description>
	<lastBuildDate>Thu, 06 Oct 2011 12:03:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Update SharePoint List ContentType Names</title>
		<link>http://www.gringod.com/2011/10/06/update-sharepoint-list-contenttype-names/</link>
		<comments>http://www.gringod.com/2011/10/06/update-sharepoint-list-contenttype-names/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 11:52:42 +0000</pubDate>
		<dc:creator>gringod</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[sharepoint]]></category>

		<guid isPermaLink="false">http://www.gringod.com/?p=841</guid>
		<description><![CDATA[I know it&#8217;s been a while since I last posted but this is going to be short and sweet. &#160;I&#8217;ve just been working on a SharePoint 2010 site where I&#8217;ve need to change the names of site content types and have the changes pushed down to a list that already uses the content types. The [...]]]></description>
			<content:encoded><![CDATA[<p>I know it&#8217;s been a while since I last posted but this is going to be short and sweet. &nbsp;I&#8217;ve just been working on a SharePoint 2010 site where I&#8217;ve need to change the names of site content types and have the changes pushed down to a list that already uses the content types.</p>
<p>The content types are deployed using a solution but that&#8217;s where the automation ends. &nbsp;However, this is where Powershell steps up to the mark. &nbsp;With Powershell we can quickly automate just about anything in SharePoint.</p>
<p>Here&#8217;s the script I can up with:</p>
<pre class="brush: powershell">
$web = Get-SPWeb http://www.example.com
$list = $web.Lists["TargetList"]
$list.ContentTypes | ForEach {
    $_.Name = $_.Parent.Name
    $_.Update()
}</pre>
 <img src="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=841" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.gringod.com/2011/10/06/update-sharepoint-list-contenttype-names/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WSPBuilder Project Migration Errors</title>
		<link>http://www.gringod.com/2009/11/17/wspbuilder-project-migration-errors/</link>
		<comments>http://www.gringod.com/2009/11/17/wspbuilder-project-migration-errors/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 11:26:16 +0000</pubDate>
		<dc:creator>gringod</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[wspbuilder]]></category>

		<guid isPermaLink="false">http://www.gringod.com/?p=799</guid>
		<description><![CDATA[Today I tried migrating a Visual Studio WPSBuilder project from one machine to another. Â The originating machine was 32bit Windows Server 2008 the destination machine was 32bit Windows Sever 2003 Standard. To migrate the project I simply zipped the solution folder and copied it across to the destination machine, unzipped and opened in Visual Studio. [...]]]></description>
			<content:encoded><![CDATA[<p>Today I tried migrating a Visual Studio WPSBuilder project from one machine to another. Â The originating machine was 32bit Windows Server 2008 the destination machine was 32bit Windows Sever 2003 Standard.</p>
<p>To migrate the project I simply zipped the solution folder and copied it across to the destination machine, unzipped and opened in Visual Studio.</p>
<p>However, when I came to build the SharePoint solution file using the Tools -&gt; WPSBuilder -&gt; Build WSP, I got the following error in the output window:<br />
&#8220;Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection&#8221;</p>
<p>When Googling the the error message the only result was on the WSP Builder CodePlex site and was about 64bit versions of the Cablib.dll assembly. Â As neither of my machines is 64bit I figured this wasn&#8217;t the issue.</p>
<p>I&#8217;m not sure exactly what was causing the problem but this was the solution:</p>
<ul style="list-style-type: disc">
<li>Open the project folder in Explorer
<ul style="list-style-type: circle">
<li>Delete the bin folder</li>
<li>Delete the obj folder</li>
<li>Delete the wsp file in the project folder.</li>
</ul>
</li>
<li>Re-open the project in Visual Studio
<ul style="list-style-type: circle">
<li>Compile the project</li>
<li>Build the WSP (Tools -&gt; WPSBuilder -&gt; Build WSP)</li>
</ul>
</li>
</ul>
<p>After this everything was back to normal.</p>
 <img src="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=799" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.gringod.com/2009/11/17/wspbuilder-project-migration-errors/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>VisendoSMTPExtender Management Web Service</title>
		<link>http://www.gringod.com/2009/05/15/visendosmtpextender-management-web-service/</link>
		<comments>http://www.gringod.com/2009/05/15/visendosmtpextender-management-web-service/#comments</comments>
		<pubDate>Fri, 15 May 2009 16:16:56 +0000</pubDate>
		<dc:creator>gringod</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://www.gringod.com/?p=760</guid>
		<description><![CDATA[Background: For work, I&#8217;m using a Windows 2008 Server virtual machine for doing all my SharePoint and .Net development on.Â  As it has got all of the cool stuff I&#8217;m working on, it is also the machine that I use to demo what I can do to clients.Â  Recently I&#8217;ve had a bit of a [...]]]></description>
			<content:encoded><![CDATA[<h3>Background:</h3>
<p>For work, I&#8217;m using a Windows 2008 Server virtual machine for doing all my SharePoint and .Net development on.Â  As it has got all of the cool stuff I&#8217;m working on, it is also the machine that I use to demo what I can do to clients.Â  Recently I&#8217;ve had a bit of a serge in the number of clients wanting to see Nintex Workflow 2007 (NFW2007) for SharePoint.</p>
<p>One of the cool features of NWF2007 is the whole Lazy Approval system, whereby users don&#8217;t have to go into SharePoint to approve to decline requests, they can just reply to the notification email with &#8220;approved&#8221;, &#8220;declined&#8221;, &#8220;ok&#8221;, &#8220;yes&#8221;, &#8220;no&#8221; or any other recognised wordÂ as the first line of the email.Â  In or to demonstrate this I need to setup and email system on my local machine.Â  The SMTP (sending) side of things is easy as it is built in to Windows 2008.Â  However, POP3 is a bit of a problem.Â  Previous version of IIS had a simple POP3 service but that has been dropped in IIS7.Â  The Microsoft way would be to install Exchange Server but that is a little too heavyweight for what I am trying to acheive.Â  Luckily a company called <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3dlYmxvZ3MuYXNwLm5ldC9ocHJlaXNodWJlci9hcmNoaXZlLzIwMDgvMDQvMzAvdmlzZW5kby1zbXRwLXBvcDMtZXh0ZW5kZXItZm9yLXdpbmRvd3MtMjAwOC1zZXJ2ZXIuYXNweA==">Visendo provides a free solution </a>to plug the gap.Â  So now I can demo Nintex notification features.</p>
<p>Another feature I also wanted to demonstrate was setting up Active Directory accounts and then using those new accounts.Â  Nintex has got actions that allow you to interact with Active Directory but to then do anything usefull with the account required modifying xml config files and restarting the Visendo service.Â  But Nintex can call web services, so I&#8217;ve created a web service that has an AddAccount and DeleteAccount methods to update the Visendo configuration and restart the service.</p>
<h3>Download:</h3>
<p>I&#8217;ve made the source code forÂ this web service freely available should anyone else want to have this sort of functionality: <a rel=\"attachment wp-att-759\" href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5ncmluZ29kLmNvbS8yMDA5LzA1LzE1L3Zpc2VuZG9zbXRwZXh0ZW5kZXItbWFuYWdlbWVudC13ZWItc2VydmljZS92aXNlbmRvc210cHNlcnZpY2Uv">VisendoSMTPService</a>.Â  The code is written against .Net 3.5 and is provided &#8220;as is&#8221; with no sort of warranty and is most definitely NOT recommended for live systems.Â  The code is released under a <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvQlNELw==">BSD License</a>.</p>
 <img src="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=760" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.gringod.com/2009/05/15/visendosmtpextender-management-web-service/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ScriptManager vs ClientScript</title>
		<link>http://www.gringod.com/2009/03/23/scriptmanager-vs-clientscript/</link>
		<comments>http://www.gringod.com/2009/03/23/scriptmanager-vs-clientscript/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 16:16:43 +0000</pubDate>
		<dc:creator>gringod</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[dynamics]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.gringod.com/?p=724</guid>
		<description><![CDATA[As part of a Microsoft Dynamics CRM customisation project, I was recently tasked with modifying an ISV add-in page so that individual sections of the page could be refreshed without having to refresh the entire page. That in itself was nice and easy, it just required the use of a couple of UpdatePanel and UpdateProgress [...]]]></description>
			<content:encoded><![CDATA[<p>As part of a Microsoft Dynamics CRM customisation project, I was recently tasked with modifying an ISV add-in page so that individual sections of the page could be refreshed without having to refresh the entire page.</p>
<p>That in itself was nice and easy, it just required the use of a couple of UpdatePanel and UpdateProgress controls to be dropped on the page along with a ScriptManager control to handle the partial postback requests.</p>
<p>However, there were a couple of gotchas that I didn&#8217;t foresee. Â Along with the partial updates, the client wanted the parts of the page to load the first time after the page had first loaded in the following order:</p>
<ol>
<li>Load base page.</li>
<li>Start load of Application Status section.</li>
<li>Start load of Risk section.</li>
<li>Start load of Alerts section.</li>
</ol>
<p>Unfortunately, the ScriptManager that comes with ASP.Net AJAX only handles one postback at a time. Â Any subsequent postbacks takeÂ precedence over earlier request, which is fine if you only have one update panel on a page but this initially resulted in only the Alerts section being loaded &#8211; the other postbacks being canceled.</p>
<p>Luckily I found a very useful post on <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2dlZWtzd2l0aGJsb2dzLm5ldC9yYXNoaWQvYXJjaGl2ZS8yMDA3LzA4LzA4L0FzcC5uZXQtQWpheC1VcGRhdGVQYW5lbC1TaW11bHRhbmVvdXMtVXBkYXRlLS0tQS1SZW1lZHkuYXNweA==">Amit&#8217;s Blog: Asp.Net Ajax UpdatePanel Simultaneous Update</a>.Â  This post provides code that queues postback requests.Â  Ideally I would have liked to have the requests happening at the same time, but this is the next best thing.</p>
<p>The other problem that I found was that one of the sections on the page had previously been dynamically creating and reqistering script that got loaded and executed when the page loaded using:</p>
<pre>Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
    "ShowNavBarItem", script.ToString());</pre>
<p>Unfortunately that doesn&#8217;t work with the AJAX ScriptManager.Â  Instead I had to change the code to use the ScriptManager to load and execute the code using the following:</p>
<pre>ScriptManager.RegisterClientScriptBlock(updatePanelApplications,
    typeof(UpdatePanel), "showNavBarItems", script.ToString(), true);</pre>
<p>This means that each time the section is updated I can re-generate the script and it will be executed again.</p>
<p>With this AJAX loading and some enhancements to the SQL code, users now get a much fasted load and response time for the page as the no longer have to wait for the whole page to be rendered before seeing information appearing on the page.</p>
<p><a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5kb3RuZXRraWNrcy5jb20va2ljay8/dXJsPWh0dHA6Ly93d3cuZ3JpbmdvZC5jb20vMjAwOS8wMy8yMy9zY3JpcHRtYW5hZ2VyLXZzLWNsaWVudHNjcmlwdC8="><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://www.gringod.com/2009/03/23/scriptmanager-vs-clientscript/" border="0" alt="kick it on DotNetKicks.com" /></a></p>
 <img src="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=724" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.gringod.com/2009/03/23/scriptmanager-vs-clientscript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microsoft Enterprise Search Roadmap</title>
		<link>http://www.gringod.com/2009/02/11/microsoft-enterprise-search-roadmap/</link>
		<comments>http://www.gringod.com/2009/02/11/microsoft-enterprise-search-roadmap/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 23:03:26 +0000</pubDate>
		<dc:creator>gringod</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[enterprise]]></category>
		<category><![CDATA[FAST]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[moss]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[sharepoint]]></category>

		<guid isPermaLink="false">http://www.gringod.com/?p=707</guid>
		<description><![CDATA[When I first started developing with SharePoint in June last year the last thing that was on my mind was Enterprise Search.Â  I had considered it the sort of technology that you just plug in a magic box and it just did all the work for you. Recently, however, I have been involved in developing [...]]]></description>
			<content:encoded><![CDATA[<p>When I first started developing with SharePoint in June last year the last thing that was on my mind was Enterprise Search.Â  I had considered it the sort of technology that you just plug in a magic box and it just did all the work for you.</p>
<p>Recently, however, I have been involved in developing a customised search solution using Microsoft Office SharePoint Server (MOSS) to allow a client to search client and non-client related documentation within their organisation.Â Â  What I rapidly discovered is that enterprise search is not a plug-and-play affair.Â  A lot of thought needs to go into the meta data that is used to define the taxonomy of the data (in this documents) and also how users are going to interact with search and how to make sure they get the information they need.</p>
<p>I have also recently been on a training course at <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mYXN0c2VhcmNoLmNvbS8=">FAST Search</a>,which was acquired by Microsoft in April 2008.Â  The course was both an introduction to the structure of FAST ESP and also an in-depth look into customising the internal, both feeding content into the indexing engine of FAST ESP and building a rich user experience for getting content from the FATS ESP search engine.</p>
<p>The two activities have really awaken me to how powerfull enterprise search can be in empowering users to find information which previously they either may not have know how to access or, more likely, simply hadn&#8217;t known existed.Â  Whilst I was learning about FAST Search, it was generally anticipated that it would be included with the next generation of MOSS.Â  Today that was confirmed at <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mYXN0Zm9yd2FyZDA5LmNvbS8=">FASTForward &#8217;09</a> when Microsoft announced its <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3ByZXNzcGFzcy9ldmVudHMvZmFzdGZvcndhcmQvZGVmYXVsdC5tc3B4">roadmap for enterprise search</a> which has two initial streams, firstly FAST Search for Internet Business which is mainly aimed at internet retail businesses &#8211; like you&#8217;d use to find products on Amazon.Â  The second, and more interesting for me, stream is FAST Search for SharePoint, which will integrate FAST Search more closely with SharePoint and would be used for the type of internal information discovery that I have been working on recently.</p>
<p>Mark Harrisson also noted on his blog that Microsoft is going to be offering ESP for SharePoint immediately which is</p>
<blockquote><p>a special offering that allows customers to purchase high-end search capabilities today, with a defined licensing path to FAST Search for SharePoint when it becomes available.</p></blockquote>
<p>I haven&#8217;t been able to find out more information about ESP for SharePoint, but it certainly looks like it could be an interesting product to get hold of.Â  I the mean time I&#8217;m keen to continue working with MOSS Enterprise Search and have just the right project lined up to flex my new found love of search on.</p>
 <img src="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=707" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.gringod.com/2009/02/11/microsoft-enterprise-search-roadmap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Try&#8230;Catch For No Reason</title>
		<link>http://www.gringod.com/2008/08/11/trycatch-for-no-reason/</link>
		<comments>http://www.gringod.com/2008/08/11/trycatch-for-no-reason/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 13:49:24 +0000</pubDate>
		<dc:creator>gringod</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[best practice]]></category>
		<category><![CDATA[Exceptions]]></category>

		<guid isPermaLink="false">http://www.gringod.com/2008/08/11/trycatch-for-no-reason/</guid>
		<description><![CDATA[Iâ€™ve seen this time and time again and Iâ€™m sure just about every developer out there has seem the same sort of thing: try { //many lines of code catch (Exception ex) { throw new Exception(&#34;Something went wrong dude!&#34;); } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: [...]]]></description>
			<content:encoded><![CDATA[<p>Iâ€™ve seen this time and time again and Iâ€™m sure just about every developer out there has seem the same sort of thing:</p>
<blockquote><pre class="csharpcode"><span class="kwrd">try</span> {
    <span class="rem">//many lines of code</span>
<span class="kwrd">catch</span> (Exception ex) {
    <span class="kwrd">throw</span> <span class="kwrd">new</span> Exception(<span class="str">&quot;Something went wrong dude!&quot;</span>);
}</pre>
</blockquote>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>This is probably the single most un-helpful piece of code a developer can write.&#160; All you are doing is making you life and future developers lives harder when it comes to debugging.&#160; The whole point of the tryâ€¦catch block is for times when you know an exception may happen and it allows you to gracefully handle it without the whole system crashing to the ground.</p>
<p>So lets have a closer look at whatâ€™s wrong with this code:</p>
<p><span id="more-679"></span></p>
<h1>Too many lines wrapped</h1>
<p>You wrap code in a tryâ€¦catch block the idea is to only wrap the code that is likely to throw an exception.&#160; Whilst it isnâ€™t impossible, it does make identifying the offending line of code harder to find.&#160; This may sound like a trivial reason to complain but when you have to deal with this day after day it does get a little tedious.</p>
<h1>Indiscriminate exception handling</h1>
<p>By catching exceptions of type Exception youâ€™re really saying to developers that come after you â€œI donâ€™t care enough about this code to know what exceptions might happen.â€?&#160; In many instances different exception types can be handled in different ways.&#160; Iâ€™m betting that the default response of most developers that catch Exception will be to throw a cryptic message at the user and drop out of whatever the method was â€“ probably without clean up resources either.</p>
<p>It is possible to have multiple catch blocks that catch different exception types if you think that there are multiple types of exceptions that might be thrown:</p>
<blockquote>
<pre class="csharpcode"><span class="kwrd">try</span> {
    File.WriteAllText<span class="str">&quot;(@&quot;</span>c:\test.txt<span class="str">&quot;, &quot;</span>Hello world!&quot;);
}
<span class="kwrd">catch</span> (FileNotFoundException ex) {
    <span class="rem">// do something</span>
}
<span class="kwrd">catch</span> (SecurityException ex) {
    <span class="rem">// do something else</span>
}</pre>
</blockquote>
<p>This means that you can handle different exceptions in different ways.&#160; Also, any type of Exception that you donâ€™t handle gets passed up the call stack.</p>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<h1>The exception isnâ€™t handled</h1>
<p>In this particular instance the exception isnâ€™t handled, so why on earth put the tryâ€¦catch block there in the first place?!&#160; If all youâ€™re going to do is throw a new exception or re-throw the old exception without doing anything youâ€™re better off leaving out the tryâ€¦catch block.&#160; It just adds overhead to instances when it runs through without exception.</p>
<h1>Original exception is masked</h1>
<p>Again, in this example a new exception is thrown.&#160; If you must do this then at least include the original exception as the inner exception (the exception that cause the new exception to be thrown).&#160; The Exception class even has a constructor to help with this:</p>
<blockquote>
<pre class="csharpcode"><span class="kwrd">public</span> Exception( <span class="kwrd">string</span> message, Exception inner )</pre>
</blockquote>
<p>Alternatively, you can throw the original exception.</p>
<h1>New exception is generalised</h1>
<p>By throwing the base Exception class you are forcing developers that use your code to have to catch exceptions of type Exception â€“ see above for why this can be bad.&#160; If you canâ€™t find a built-in exception class to use, and there are many, create your own.&#160; Visual Studio 2008 has a code snippet for creating an exception class, all you have to do is fill-in the blanks.</p>
<h1>In an ideal worldâ€¦</h1>
</p>
<p>â€¦ Iâ€™d like .Net to have a similar method to java of having to specify (use attributes) what exceptions a method throws or catches.&#160; This allows you to easily find out what exceptions may originate in a method your code calls, and let other developers know what exceptions your code doesnâ€™t handle.&#160; It also allows for pretty good compile time exception checking.&#160; It means extra code has to be written but I think it results in better code.</p>
 <img src="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=679" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.gringod.com/2008/08/11/trycatch-for-no-reason/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SharePoint Event Receiver Manager</title>
		<link>http://www.gringod.com/2008/07/14/sharepoint-event-receiver-manager/</link>
		<comments>http://www.gringod.com/2008/07/14/sharepoint-event-receiver-manager/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 14:42:40 +0000</pubDate>
		<dc:creator>gringod</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[moss]]></category>
		<category><![CDATA[Receiver]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[wss]]></category>

		<guid isPermaLink="false">http://www.gringod.com/?p=675</guid>
		<description><![CDATA[One of the things Iâ€™m working on is Event Receivers in SharePoint but Iâ€™ve found registering the event receivers to be a bit on the annoying side.Â  Yes you can do it with the feature.xml Receivers section and there is the great El Blanco Event Receivers Manager. I personally prefer desktop GUI applications and so, [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things Iâ€™m working on is Event Receivers in SharePoint but Iâ€™ve found registering the event receivers to be a bit on the annoying side.Â  Yes you can do it with the feature.xml Receivers section and there is the great <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Nocmlzc3libGFuY28uYmxvZ3Nwb3QuY29tLzIwMDcvMDgvZXZlbnQtcmVjZWl2ZXItbWFuYWdlbWVudC5odG1s">El Blanco Event Receivers Manager</a>.</p>
<p><a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5ncmluZ29kLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAwOC8wNy9ldmVudHJlY2VpdmVybWFuYWdlci5wbmc="><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" title="EventReceiverManager" src="http://www.gringod.com/wp-content/uploads/2008/07/eventreceivermanager-thumb.png" border="0" alt="EventReceiverManager" width="244" height="156" align="right" /></a>I personally prefer desktop GUI applications and so, <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2xpcmxpcm9uLmJsb2dzcG90LmNvbS8yMDA3LzA4L21vc3MtbGlzdC1ldmVudC1yZWNlaXZlci1yZWdpc3Rlcl8wOC5odG1s">based on code by Liron</a>, Iâ€™ve created my own desktop Event Receiver Manager.Â  It allows you to select site &amp; list, browse for an assembly so it can give you the full assembly name and a list of classes inside, and a list of receivers you can attach to.</p>
<p>The current version only allows adding new event receivers.Â  Before adding a new receiver it will check to make sure the same receiver doesnâ€™t already exist.</p>
<p>Future plans for it include listing existing receivers to allow users to delete them but as I donâ€™t need to do that myself yet I havenâ€™t implemented it.</p>
<p>Download a copy of <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5ncmluZ29kLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAwOC8wNy9ldmVudHJlY2VpdmVybWFuYWdlci56aXA=">EventReceiverManager</a>.</p>
 <img src="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=675" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.gringod.com/2008/07/14/sharepoint-event-receiver-manager/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Character Counter</title>
		<link>http://www.gringod.com/2008/02/08/character-counter/</link>
		<comments>http://www.gringod.com/2008/02/08/character-counter/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 15:13:43 +0000</pubDate>
		<dc:creator>gringod</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[.net2]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[bsd license]]></category>
		<category><![CDATA[character counter]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://www.gringod.com/2008/02/08/character-counter/</guid>
		<description><![CDATA[Whilst reading an article I was curious about the number of commas and full-stops that the author used &#8211; when you become an editor of a newsletter you start to think about things like this.&#160; After hunting around the various utilities on my system I discovered that I didn&#8217;t have anything that could easily do [...]]]></description>
			<content:encoded><![CDATA[<p>Whilst reading an article I was curious about the number of commas and full-stops that the author used &#8211; when you become an editor of a newsletter you start to think about things like this.&nbsp; After hunting around the various utilities on my system I discovered that I didn&#8217;t have anything that could easily do this.&nbsp; So, I did what any self-respecting programmer would do and threw together a quick app to do it for me.</p>
<p>I have made both the <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5ncmluZ29kLmNvbS93cC11cGxvYWRzL3NvZnR3YXJlL0NoYXJhY3RlckNvdW50ZXJfc3JjLnppcA==">source code</a> and <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5ncmluZ29kLmNvbS93cC11cGxvYWQvc29mdHdhcmUvQ2hhcmFjdGVyQ291bnRlcl9iaW4uemlw">pre-compiled binary</a> available for download under a <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvQlNELw==">BSD license</a> (<font color="#008000">share</font>, <font color="#008000">remix</font>, <font color="#800000">no endorsement</font>).&nbsp; It is written in C# and requires the .Net 2.0 framework, if you want to compile the source you will probably require MS Visual Studio (Express should be ok), although it may work with <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5pY3NoYXJwY29kZS5uZXQvT3BlblNvdXJjZS9TRC8=">SharpDevelop</a> or <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5tb25vLXByb2plY3QuY29tL01haW5fUGFnZQ==">Mono</a>.</p>
<p>It is a console application (sorry, no pretty GUI this time) that reads the contents of input.txt (in the same directory as the app), it then counts the occurrences of each character and outputs the results to the console. Simple!</p>
<p>If you make any improvements to the code please leave a comment and/or email the changes to me: gringod [at] gmail [dot] com.</p>
<p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:39c46d67-44ab-4f86-8e8d-f0aba1be91e8" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL3RhZ3MvY3NoYXJw" rel=\"tag\">csharp</a>,<a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL3RhZ3MvcHJvZ3JhbW1pbmc=" rel=\"tag\">programming</a>,<a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL3RhZ3MvY2hhcmFjdGVyJTIwY291bnRlcg==" rel=\"tag\">character counter</a>,<a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL3RhZ3Mvc291cmNlJTIwY29kZQ==" rel=\"tag\">source code</a>,<a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL3RhZ3MvYXBwbGljYXRpb24=" rel=\"tag\">application</a>,<a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL3RhZ3MvLm5ldDI=" rel=\"tag\">.net2</a>,<a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL3RhZ3MvYnNkJTIwbGljZW5zZQ==" rel=\"tag\">bsd license</a></div></p>
 <img src="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=615" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.gringod.com/2008/02/08/character-counter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test Driven Porting</title>
		<link>http://www.gringod.com/2007/11/20/test-driven-porting/</link>
		<comments>http://www.gringod.com/2007/11/20/test-driven-porting/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 15:34:33 +0000</pubDate>
		<dc:creator>gringod</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Bell Ringing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Test-Driven-Development]]></category>
		<category><![CDATA[Test-Driven-Porting]]></category>

		<guid isPermaLink="false">http://www.gringod.com/2007/11/20/test-driven-porting/</guid>
		<description><![CDATA[Technorati Tags: Test-Driven-Development , Test-Driven-Porting , .Net , C# , C++ , Programming Recently I&#8217;ve had reason to take an code library written in C++ and port it to C#.&#xA0; Whilst I dabbled in C++ on a compilers course at university, I hated it then and I still hate it now.&#xA0; I personally think it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:00c73987-59b1-4d1a-a2cb-32b32ed5f479" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags:  		<a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL3RhZ3MvVGVzdC1Ecml2ZW4tRGV2ZWxvcG1lbnQv" rel=\"tag\">Test-Driven-Development</a> 		,  		<a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL3RhZ3MvVGVzdC1Ecml2ZW4tUG9ydGluZy8=" rel=\"tag\">Test-Driven-Porting</a> 		,  		<a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL3RhZ3MvLk5ldC8=" rel=\"tag\">.Net</a> 		,  		<a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL3RhZ3MvQyMv" rel=\"tag\">C#</a> 		,  		<a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL3RhZ3MvQysrLw==" rel=\"tag\">C++</a> 		,  		<a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL3RhZ3MvUHJvZ3JhbW1pbmcv" rel=\"tag\">Programming</a> 		</div>
<p>Recently I&#8217;ve had reason to take an code library written in C++ and port it to C#.&#xA0; Whilst I dabbled in C++ on a compilers course at university, I hated it then and I still hate it now.&#xA0; I personally think it&#8217;s an abomination and should be consigned to the great garbage collector in the sky.&#xA0;&#xA0; Whilst I can just about read the C++ syntax there is a lot that I don&#8217;t understand about it.</p>
<p>The library I was porting had semi reasonable documentation outlining what classes exist and their methods and a brief description of the overall usage.&#xA0; This gave me a good starting point, however the documentation didn&#8217;t include example usages and expected results, for this I was forced to delve into the code.</p>
<p>One development paradigm I have been interested in but have been unable to find a decent project to test it on is Test-Driven-Development and this seemed like the perfect project to try it on.&#xA0; So I set to work on the first iteration getting the test set up.&#xA0;&#xA0; Without knowing exactly what results I should be expecting I was finding it hard going, so once again I dived back into the old code.</p>
<p>Thankfully, the developers of the C++ library had create a fairly comprehensive set of unit tests and with my limited C++ knowledge and a text editor with RegEx Find &amp; Replace I was quickly able to convert their unit tests into NUnit based unit tests.</p>
<p>For example, what started out life as:</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span><span class="kwrd">void</span> test_row_multiply_change(<span class="kwrd">void</span>)</pre>
<pre><span class="lnum"> 2: </span>{</pre>
<pre class="alt"><span class="lnum"> 3: </span> row r;</pre>
<pre><span class="lnum"> 4: </span> RINGING_TEST( ( r *= change( 6, <span class="str">&quot;X&quot;</span> ) ) == <span class="str">&quot;214365&quot;</span> );</pre>
<pre class="alt"><span class="lnum"> 5: </span> RINGING_TEST( ( r *= change( 6, <span class="str">&quot;1&quot;</span> ) ) == <span class="str">&quot;241635&quot;</span> );</pre>
<pre><span class="lnum"> 6: </span> RINGING_TEST( ( r *= change( 8, <span class="str">&quot;X&quot;</span> ) ) == <span class="str">&quot;42615387&quot;</span> );</pre>
<pre class="alt"><span class="lnum"> 7: </span> RINGING_TEST( ( r *= change( 5, <span class="str">&quot;3&quot;</span> ) ) == <span class="str">&quot;24651387&quot;</span> );</pre>
<pre><span class="lnum"> 8: </span>&#xA0;</pre>
<pre class="alt"><span class="lnum"> 9: </span> RINGING_TEST( row( <span class="str">&quot;214365&quot;</span> ) * change( 7, <span class="str">&quot;5&quot;</span> ) == row( <span class="str">&quot;1234675&quot;</span> ) );</pre>
<pre><span class="lnum"> 10: </span>}</pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Quickly became:</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span>[Test]</pre>
<pre><span class="lnum"> 2: </span><span class="kwrd">public</span> <span class="kwrd">void</span> TestMultiplicationByChange()</pre>
<pre class="alt"><span class="lnum"> 3: </span>{</pre>
<pre><span class="lnum"> 4: </span> Row r = <span class="kwrd">new</span> Row();</pre>
<pre class="alt"><span class="lnum"> 5: </span> Assert.AreEqual((Row)<span class="str">&quot;214365&quot;</span>, r *= <span class="kwrd">new</span> Change(6, <span class="str">&quot;X&quot;</span>) );</pre>
<pre><span class="lnum"> 6: </span> Assert.AreEqual((Row)<span class="str">&quot;241635&quot;</span>, r *= <span class="kwrd">new</span> Change(6, <span class="str">&quot;1&quot;</span>));</pre>
<pre class="alt"><span class="lnum"> 7: </span> Assert.AreEqual((Row)<span class="str">&quot;42615387&quot;</span>, r *= <span class="kwrd">new</span> Change(8, <span class="str">&quot;X&quot;</span> ));</pre>
<pre><span class="lnum"> 8: </span> Assert.AreEqual((Row)<span class="str">&quot;24651387&quot;</span>, r *= <span class="kwrd">new</span> Change(5, <span class="str">&quot;3&quot;</span>));</pre>
<pre class="alt"><span class="lnum"> 9: </span>&#xA0;</pre>
<pre><span class="lnum"> 10: </span> Assert.AreEqual((Row)<span class="str">&quot;1234675&quot;</span>, <span class="kwrd">new</span> Row(<span class="str">&quot;214365&quot;</span>) * <span class="kwrd">new</span> Change(7, <span class="str">&quot;5&quot;</span>));</pre>
<pre class="alt"><span class="lnum"> 11: </span>}</pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Now, with a full set of unit tests at my disposal I was quickly able to bash away at the library and very quickly got working code without the need to trawl through ghastly C++ code.</p>
<p>Hooray for Test-Driven-Development and three cheers for Test-Driven-Porting.</p>
<p><font size="1">ps. The library I&#8217;m porting is an open source library for Bell Ringing &#8211; yes I know I&#8217;m a geek but anyone that has followed everything else in this post must also be a geek <img src='http://www.gringod.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .&#xA0; Once I&#8217;m finished I will be releasing my code under an open source license as well, I just need to pick the right one.</font></p>
<p><font size="1">pps. I may have exaggerated my hate of C++ a little.&#xA0; I believe all languages have their place, even the </font><a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Vzb3RlcmljLnZveGVscGVyZmVjdC5uZXQvd2lraS9MYW5ndWFnZV9saXN0"><font size="1">esoteric languages</font></a><font size="1"> like </font><a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2xvbGNvZGUuY29tLw=="><font size="1">LOLCode</font></a><font size="1">.</font></p>
<div class="wlWriterSmartContent" id="scid:C16BAC14-9A3D-4c50-9394-FBFEF7A93539:cf502d0c-443d-4be4-88e5-3d2832bfad62" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"><a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5kb3RuZXRraWNrcy5jb20va2ljay8/dXJsPWh0dHA6Ly93d3cuZ3JpbmdvZC5jb20vMjAwNy8xMS8yMC90ZXN0LWRyaXZlbi1wb3J0aW5nLw=="><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://www.gringod.com/2007/11/20/test-driven-porting/" border="0" alt="kick it on DotNetKicks.com" /></a></div>
 <img src="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=605" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.gringod.com/2007/11/20/test-driven-porting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>System.IO.Path.Combine()</title>
		<link>http://www.gringod.com/2007/10/12/systemiopathcombine/</link>
		<comments>http://www.gringod.com/2007/10/12/systemiopathcombine/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 12:59:30 +0000</pubDate>
		<dc:creator>gringod</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.gringod.com/2007/10/12/systemiopathcombine/</guid>
		<description><![CDATA[Many, many times in my programming life I have seen people causing themselves all sorts of problems as the try and concatenate paths for file and directories.&#xA0; They&#8217;re always trying to work if the path already ends with a directory separator or not.&#xA0; And then there are the cross platform systems that try&#xA0; to workout [...]]]></description>
			<content:encoded><![CDATA[<p>Many, many times in my programming life I have seen people causing themselves all sorts of problems as the try and concatenate paths for file and directories.&#xA0; They&#8217;re always trying to work if the path already ends with a directory separator or not.&#xA0; And then there are the cross platform systems that try&#xA0; to workout what the directory separator should be.</p>
<p> With the release of the .Net platform,&#xA0; Microsoft gave developers that need to handle file system operations a wonderful, but underused, utility class: <a title=\"Path Class\" href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21zZG4yLm1pY3Jvc29mdC5jb20vM2JkenlzOXcuYXNweA==">System.IO.Path</a>.&#xA0; One of the methods on this class is <a title=\"Combine Method\" href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21zZG4yLm1pY3Jvc29mdC5jb20vZnl5N2E1a3QuYXNweA==">Combine()</a>.&#xA0; It take two arguments: path1 (string) and path2 (string), and intelligently combines them.</p>
<p>That&#8217;s it!&#xA0; No more messing around with string concatenation or endless if statements or figuring out if it should be a forward or backslash&#8230; just <a title=\"Combine Method\" href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21zZG4yLm1pY3Jvc29mdC5jb20vZnl5N2E1a3QuYXNweA==">Path.Combine()</a>.</p>
<p><a href="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5kb3RuZXRraWNrcy5jb20va2ljay8/dXJsPWh0dHAlM2ElMmYlMmZ3d3cuZ3JpbmdvZC5jb20lMmYyMDA3JTJmMTAlMmYxMiUyZnN5c3RlbWlvcGF0aGNvbWJpbmUlMmY="><img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.gringod.com%2f2007%2f10%2f12%2fsystemiopathcombine%2f" border="0" /></a></p>
 <img src="http://www.gringod.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=591" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.gringod.com/2007/10/12/systemiopathcombine/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

