<?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>Alex James Brown &#187; Visual Studio</title>
	<atom:link href="http://www.alexjamesbrown.com/categories/geek/software/visual-studio/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alexjamesbrown.com</link>
	<description>My Words. By Me.</description>
	<lastBuildDate>Fri, 03 Sep 2010 14:59:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>C# 4.0 &#8211; Optional Parameters</title>
		<link>http://www.alexjamesbrown.com/geek/visual-studio-2010-optional-parameters/</link>
		<comments>http://www.alexjamesbrown.com/geek/visual-studio-2010-optional-parameters/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 14:59:47 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[c# .net 4.0]]></category>

		<guid isPermaLink="false">http://www.alexjamesbrown.com/geek/visual-studio-2010-optional-parameters/</guid>
		<description><![CDATA[I know, I know, VB has had them for ages. But I don’t care… Now C# has them too! This will greatly reduce method overloads! Check this bit of code (sorry it’s not a “real world” example) public class TestClass { public void DoSomething(string parameterOne, string parameterTwo, string parameterThree) { DoSomething(parameterOne, parameterTwo, parameterThree, null); } [...]]]></description>
			<content:encoded><![CDATA[<p>I know, I know, VB has had them for ages.</p>
<p>But I don’t care… Now C# has them too!</p>
<p>This will greatly reduce method overloads!    <br />Check this bit of code (sorry it’s not a “real world” example)</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:4a59f3eb-a85b-4cdc-ac0a-0dfde9af6ebe" class="wlWriterEditableSmartContent">
<pre class="brush: c#;gutter:false;">public class TestClass
{
    public void DoSomething(string parameterOne, string parameterTwo, string parameterThree)
    {
        DoSomething(parameterOne, parameterTwo, parameterThree, null);
    }

    public void DoSomething(string parameterOne, string parameterTwo, string parameterThree, string parameterFour)
    {
        if (parameterFour != null)
        {
            //doing somthing with the parameters.
        }
    }
}</pre>
</div>
<p>The <strong>DoSomething </strong>method has an overload on it that takes a fourth parameter (in this case parameterFour)</p>
<p>When we use the above code, our intellisense looks like this:</p>
<p>&#160;</p>
<p><a href="http://www.alexjamesbrown.com/wp-content/uploads/overload1.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="overload1" border="0" alt="overload1" src="http://www.alexjamesbrown.com/wp-content/uploads/overload1_thumb.png" width="450" height="89" /></a> </p>
<p>…and the second overload</p>
<p>&#160;</p>
<p><a href="http://www.alexjamesbrown.com/wp-content/uploads/overload2.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="overload2" border="0" alt="overload2" src="http://www.alexjamesbrown.com/wp-content/uploads/overload2_thumb.png" width="450" height="81" /></a> </p>
<p>As we can see, the method has 2 overloads. One taking parameterFour, one not.</p>
<p>New in C# 4.0, we can use something called optional parameters.</p>
<p>This allows us to change our method to:</p>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:bb9d7972-5fd4-4066-acd3-99d935c1da51" class="wlWriterEditableSmartContent">
<pre class="brush: c#;gutter:false;">public class TestClass
{
    public void DoSomething(string parameterOne, string parameterTwo, string parameterThree, string parameterFour = null)
    {
        if (parameterFour != null)
        {
            //doing something with the parameters.
        }
    }
}</pre>
</div>
<p>As you can see, we’ve removed the overloaded method – I’m sure you can appreciate, if we had a method with many overloads, this results in much cleaner code <img src='http://www.alexjamesbrown.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Now, our intellisense looks like this:</p>
<p><a href="http://www.alexjamesbrown.com/wp-content/uploads/intellisensewithoptionalparametermethod.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="intellisense-with-optional-parameter-method" border="0" alt="intellisense-with-optional-parameter-method" src="http://www.alexjamesbrown.com/wp-content/uploads/intellisensewithoptionalparametermethod_thumb.png" width="450" height="79" /></a> </p>
<p>In my opinion, this looks a bit confusing.<br />
  <br />Sure, I’ll get used to it, but in my opinion, the method is still <em>sort of</em> overloaded… just with optional parameters!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjamesbrown.com/geek/visual-studio-2010-optional-parameters/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Location of Visual Studio Templates Directory</title>
		<link>http://www.alexjamesbrown.com/geek/software/visual-studio/location-of-visual-studio-templates-directory/</link>
		<comments>http://www.alexjamesbrown.com/geek/software/visual-studio/location-of-visual-studio-templates-directory/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 09:05:58 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.alexjamesbrown.com/geek/software/visual-studio/location-of-visual-studio-templates-directory/</guid>
		<description><![CDATA[The location of the Visual Studio Templates Directory (when installed on Vista) is as follows: C:\Users\&#60;user&#62;\Documents\Visual Studio &#60;version&#62;\Templates Replace &#60;user&#62; with your username &#60;version&#62; with the version of VS (in my case its 2008) so my path is: C:\Users\ABrown\Documents\Visual Studio 2008\Templates]]></description>
			<content:encoded><![CDATA[<p>The location of the Visual Studio Templates Directory (when installed on Vista) is as follows:</p>
<p>C:\Users\&lt;user&gt;\Documents\Visual Studio &lt;version&gt;\Templates</p>
<p>Replace &lt;user&gt; with your username   <br />&lt;version&gt; with the version of VS (in my case its 2008) so my path is:</p>
<p>C:\Users\ABrown\Documents\Visual Studio 2008\Templates</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjamesbrown.com/geek/software/visual-studio/location-of-visual-studio-templates-directory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Show line numbers in Visual Studio 2008</title>
		<link>http://www.alexjamesbrown.com/geek/software/visual-studio/show-line-numbers-in-visual-studio-2008/</link>
		<comments>http://www.alexjamesbrown.com/geek/software/visual-studio/show-line-numbers-in-visual-studio-2008/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 16:21:48 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.alexjamesbrown.com/geek/software/visual-studio/show-line-numbers-in-visual-studio-2008/</guid>
		<description><![CDATA[I recently reset my settings in Visual Studio which, irritatingly, made my line numbers disappear. To re-instate the line numbers, there is a simple process: Click: Tools &#62; Options &#62; Text Editor &#62; All Languages &#62; General On the right, under Display section, check Line numbers (see below) Click Ok.]]></description>
			<content:encoded><![CDATA[<p>I recently <a href="http://www.alexjamesbrown.com/geek/software/visual-studio/reset-ide-settings-in-visual-studio-2008/" target="_blank">reset my settings in Visual Studio</a> which, irritatingly, made my line numbers disappear.</p>
<p>To re-instate the line numbers, there is a simple process:</p>
<p>Click:   <br />Tools &gt; Options &gt; Text Editor &gt; All Languages &gt; General</p>
<p>On the right, under Display section, check Line numbers (see below)</p>
<p>Click Ok.</p>
<p><img title="showLineNumbersVS2008_1" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="274" alt="showLineNumbersVS2008_1" src="http://www.alexjamesbrown.com/wp-content/uploads/ShowlinenumbersinVisualStudio2008_EE25/showLineNumbersVS2008_1.jpg" width="474" border="0" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjamesbrown.com/geek/software/visual-studio/show-line-numbers-in-visual-studio-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reset IDE settings in Visual Studio 2008</title>
		<link>http://www.alexjamesbrown.com/geek/software/visual-studio/reset-ide-settings-in-visual-studio-2008/</link>
		<comments>http://www.alexjamesbrown.com/geek/software/visual-studio/reset-ide-settings-in-visual-studio-2008/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 16:15:52 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.alexjamesbrown.com/geek/software/visual-studio/reset-ide-settings-in-visual-studio-2008/</guid>
		<description><![CDATA[I recently acquired a PC at my new job where there was an existing installation of Visual Studio. This was fine, however it was set up for a VB.net developer. Whilst I do use VB.net, I didn’t want my VS set up this way. I wanted to re-instate that lovely screen you see when you [...]]]></description>
			<content:encoded><![CDATA[<p> I recently acquired a PC at my new job where there was an existing installation of Visual Studio.</p>
<p>This was fine, however it was set up for a VB.net developer.   <br />Whilst I do use VB.net, I didn’t want my VS set up this way.</p>
<p>I wanted to re-instate that lovely screen you see when you fresh install VS (below) </p>
<p><img title="resetVS2008Settings_0" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="214" alt="resetVS2008Settings_0" src="http://www.alexjamesbrown.com/wp-content/uploads/ResetIDEsettingsinVisualStudio2008_F1D0/resetVS2008Settings_0.jpg" width="240" border="0" /></p>
<p>To do this, simply click: </p>
<p>Tools &gt; Import and Export Settings Editor</p>
<p><img title="resetVS2008Settings_1" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="resetVS2008Settings_1" src="http://www.alexjamesbrown.com/wp-content/uploads/ResetIDEsettingsinVisualStudio2008_F1D0/resetVS2008Settings_1.jpg" width="161" border="0" /> </p>
<p>Click Reset all settings</p>
<p><img title="resetVS2008Settings_2" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="214" alt="resetVS2008Settings_2" src="http://www.alexjamesbrown.com/wp-content/uploads/ResetIDEsettingsinVisualStudio2008_F1D0/resetVS2008Settings_2.jpg" width="240" border="0" /> </p>
<p>I didn’t backup my settings as the guy working here before had gone… But this screen gives you the option to.</p>
<p><img title="resetVS2008Settings_3" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="214" alt="resetVS2008Settings_3" src="http://www.alexjamesbrown.com/wp-content/uploads/ResetIDEsettingsinVisualStudio2008_F1D0/resetVS2008Settings_3.jpg" width="240" border="0" />&#160; </p>
<p>And there we are.   <br />All settings can be reset to a theme of your choice.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjamesbrown.com/geek/software/visual-studio/reset-ide-settings-in-visual-studio-2008/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
