<?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>richard-slater.co.uk &#187; CodeRush</title>
	<atom:link href="http://www.richard-slater.co.uk/archives/tag/coderush/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.richard-slater.co.uk</link>
	<description>Jesus, Life, Programming and Systems Administration</description>
	<lastBuildDate>Mon, 02 Jan 2012 10:07:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Changing code accessibility modifiers quickly</title>
		<link>http://www.richard-slater.co.uk/archives/2010/10/12/changing-code-accessibility-modifiers-quickly/</link>
		<comments>http://www.richard-slater.co.uk/archives/2010/10/12/changing-code-accessibility-modifiers-quickly/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 20:20:48 +0000</pubDate>
		<dc:creator>Richard Slater</dc:creator>
				<category><![CDATA[CodeRush]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.richard-slater.co.uk/?p=817</guid>
		<description><![CDATA[I have two hints today both of them involving changing accessibility modifiers. The first is a feature of CodeRush that I accidentally discovered while testing out the Visual Studio 2010 Productivity Power Tools the second is a great new feature of Visual Studio 2010. For those who don&#8217;t know what I mean by accessibility modifiers, [...]]]></description>
			<content:encoded><![CDATA[<p>I have two hints today both of them involving changing accessibility modifiers. The first is a feature of CodeRush that I accidentally discovered while testing out the <a href="http://visualstudiogallery.msdn.microsoft.com/en-us/d0d33361-18e2-46c0-8ff2-4adea1e34fef?SRC=VSIDE">Visual Studio 2010 Productivity Power Tools</a> the second is a great new feature of Visual Studio 2010.</p>
<p>For those who don&#8217;t know what I mean by <a href="http://msdn.microsoft.com/en-us/library/ms173121(v=VS.100).aspx">accessibility modifiers</a>, those are the keywords you put before blocks of code that define how that code can be accessed, this is all enforced by the compiler giving you nice compiler error messages if you violate these rules. To provide an example the following auto-properties are all have the accessibility modifier &#8220;public&#8221;:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>Column<span style="color: #008000;">&#93;</span> <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Name <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#91;</span>Column<span style="color: #008000;">&#93;</span> <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Description <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#91;</span>Column<span style="color: #008000;">&#93;</span> <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">decimal</span> Price <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#91;</span>Column<span style="color: #008000;">&#93;</span> <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Category <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span></pre></div></div>

<p>CodeRush gives you a handy way to change the User interface by clicking the icon to the left of the code block, you then get a set of actions you can perform upon the that block of code.</p>
<p><a href="http://www.richard-slater.co.uk/wp-content/uploads/2010/10/CodeRushCodeContextMenu.png"><img class="aligncenter size-full wp-image-820" title="Code Rush Code Context Menu" src="http://www.richard-slater.co.uk/wp-content/uploads/2010/10/CodeRushCodeContextMenu.png" alt="Code Rush Code Context Menu" width="398" height="162" /></a></p>
<p>As with most everything in CodeRush you can access this functionality from the keyboard anywhere within the scope of that code block by pressing Alt + Up or Alt + Down to cycle through the five possibilities:</p>
<ul>
<li>public</li>
<li>internal</li>
<li>protected internal</li>
<li>protected</li>
<li>private</li>
</ul>
<p>This means that if you need to change access modifiers, either to tighten up or relax the access points into your code you can do it by pressing a hand full of keys (between two and six to be exact), much faster than navigating to the top of the method highlighting and replacing the keyword.</p>
<p>My second hint is something that I have been using quite regularly, lets take the above example again:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>Column<span style="color: #008000;">&#93;</span> <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Name <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#91;</span>Column<span style="color: #008000;">&#93;</span> <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Description <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#91;</span>Column<span style="color: #008000;">&#93;</span> <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">decimal</span> Price <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#91;</span>Column<span style="color: #008000;">&#93;</span> <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Category <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span></pre></div></div>

<p>I want to change all four fields to &#8220;be internal&#8221;, I could go in and change each one manually or better still use the above keyboard shortcuts (Alt + Down, Down, Alt + Down, etc.) the faster alternative would be to hold down the Alt key then select from the first character of the first &#8220;public&#8221; to the last character of the last &#8220;public&#8221; keyword.</p>
<p>While holding down Alt traditional selection behaviour is not followed and only the &#8220;public&#8221; keywords are selected on all four lines:</p>
<p><a href="http://www.richard-slater.co.uk/wp-content/uploads/2010/10/VS2010LineSelect.jpg"><img class="aligncenter size-full wp-image-821" title="VS2010 Line Select" src="http://www.richard-slater.co.uk/wp-content/uploads/2010/10/VS2010LineSelect.jpg" alt="VS2010 Line Select" width="558" height="110" /></a></p>
<p>You can then type your new visibility modifier overwriting the selected components of all four lines in one fell swoop:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>Column<span style="color: #008000;">&#93;</span> <span style="color: #0600FF; font-weight: bold;">internal</span> <span style="color: #6666cc; font-weight: bold;">string</span> Name <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#91;</span>Column<span style="color: #008000;">&#93;</span> <span style="color: #0600FF; font-weight: bold;">internal</span> <span style="color: #6666cc; font-weight: bold;">string</span> Description <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#91;</span>Column<span style="color: #008000;">&#93;</span> <span style="color: #0600FF; font-weight: bold;">internal</span> <span style="color: #6666cc; font-weight: bold;">decimal</span> Price <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#91;</span>Column<span style="color: #008000;">&#93;</span> <span style="color: #0600FF; font-weight: bold;">internal</span> <span style="color: #6666cc; font-weight: bold;">string</span> Category <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span></pre></div></div>

<p>I think that is neat!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richard-slater.co.uk/archives/2010/10/12/changing-code-accessibility-modifiers-quickly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adjusting Selections in CodeRush Xpress</title>
		<link>http://www.richard-slater.co.uk/archives/2009/10/16/adjusting-selections-in-coderush-xpress/</link>
		<comments>http://www.richard-slater.co.uk/archives/2009/10/16/adjusting-selections-in-coderush-xpress/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 19:30:24 +0000</pubDate>
		<dc:creator>Richard Slater</dc:creator>
				<category><![CDATA[CodeRush]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[DevExpress]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Resharper]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.richard-slater.co.uk/?p=663</guid>
		<description><![CDATA[I found this function totally accidentally when I knocked my mouse into a key when something interesting popped up on Twitter. I happened to have a variable selected like so: The key that I knocked was the Number Pad &#8220;+&#8221; key, and it expanded the selection like this: As any self respecting Systems Administrator would [...]]]></description>
			<content:encoded><![CDATA[<p>I found this function totally accidentally when I knocked my mouse into a key when something interesting popped up on Twitter. I happened to have a variable selected like so:</p>
<p><img class="size-full wp-image-664 alignnone" title="Variable Selected" src="http://www.richard-slater.co.uk/wp-content/uploads/2009/10/VariableSelected.JPG" alt="Variable Selected in Visual Studio" width="198" height="69" /></p>
<p>The key that I knocked was the Number Pad &#8220;+&#8221; key, and it expanded the selection like this:</p>
<p><img class="alignnone size-full wp-image-665" title="VariableSelectedPlus1" src="http://www.richard-slater.co.uk/wp-content/uploads/2009/10/VariableSelectedPlus1.JPG" alt="VariableSelectedPlus1" width="184" height="70" /></p>
<p>As any self respecting Systems Administrator would do I wondered if doing exactly the same thing repeatedly would have equal or compound effects.</p>
<p><img class="alignnone size-full wp-image-666" title="VariableSelectedAgainAgain" src="http://www.richard-slater.co.uk/wp-content/uploads/2009/10/VariableSelectedAgainAgain.JPG" alt="VariableSelectedAgainAgain" width="535" height="158" /></p>
<p>Strangely enough it worked, the selection will continue to expand selecting increasingly larger sections of code. The reverse works as well if you press the Number Pad &#8220;-&#8221; key the selection will be reduced.</p>
<dl id="attachment_667" class="wp-caption alignright" style="width: 298px;">
<dt class="wp-caption-dt"><img class="size-full wp-image-667  " title="WhatHappened" src="http://www.richard-slater.co.uk/wp-content/uploads/2009/10/WhatHappened.png" alt="WhatHappened" width="288" height="178" /></dt>
</dl>
<p>As I was looking for <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/CodeRushX/selection.xml">documentation</a> on this function; I found that you could use the CamelCase select function to start selections off using Ctrl+Shift+Left (or Ctrl+Shift+Right) this will take your selection from the current cursor position to the next upper case character to the left (or right). This can be coupled with the Number Pad &#8220;+&#8221; to expand your selection from a variable to an expression, to a line then a block. Neat!</p>
<p>Each of these discoveries was announced with a handy little popup in the bottom right hand corner of the viewport telling me what happened, and if relevant what function was suppressed.</p>
<p>I am going to make a concerted effort to spend my lunch break watching some more videos on DevExpress&#8217; training site. I got 10 minutes today and watched what appeared to be footage from a launch event or a conference which was interesting but didn&#8217;t really teach me anything specifically.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richard-slater.co.uk/archives/2009/10/16/adjusting-selections-in-coderush-xpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Find Files in CodeRush Xpress</title>
		<link>http://www.richard-slater.co.uk/archives/2009/10/12/find-files-in-coderush-xpress/</link>
		<comments>http://www.richard-slater.co.uk/archives/2009/10/12/find-files-in-coderush-xpress/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 12:27:41 +0000</pubDate>
		<dc:creator>Richard Slater</dc:creator>
				<category><![CDATA[CodeRush]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[DevExpress]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Resharper]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.richard-slater.co.uk/?p=657</guid>
		<description><![CDATA[As I mentioned in my previous entry I have started using DevExpress&#8217;s CodeRush Xpress. It is a free cut down version of CodeRush that I heard about in an episode of .NET Rocks. I have wanted add something to my Visual Studio development experience and I can&#8217;t justify the cost of either Resharper or CodeRush [...]]]></description>
			<content:encoded><![CDATA[<p>As I mentioned in my previous entry I have started using <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/CodeRushX/Index.xml">DevExpress&#8217;s CodeRush Xpress</a>. It is a free cut down version of <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/">CodeRush</a> that I heard about in an episode of <a href="http://www.dotnetrocks.com/">.NET Rocks</a>. I have wanted add something to my Visual Studio development experience and I can&#8217;t justify the cost of either Resharper or CodeRush at the moment. There has been quite a bit of discussion about <a href="http://www.hanselman.com/blog/ReSharperVsCodeRush.aspx">Resharper vs. CodeRush</a> and in my experience most people I have spoken to love one and hate the other.</p>
<p>I hope to be able to write a series of posts about some of the features found in CodeRush Xpress which I hope will clarify their purpose and use in my mind and maybe help someone find the function they are looking for.</p>
<p><img class="alignleft size-full wp-image-658" title="QuickFileNavigationAbou" src="http://www.richard-slater.co.uk/wp-content/uploads/2009/10/QuickFileNavigationAbou.png" alt="QuickFileNavigationAbou" width="323" height="154" />First off &#8220;Quick File Navigation&#8221;, this is a search function for locating a file by file name, I am finding it increasingly useful when looking through patches as it allows me to very quickly jump to a file name. Particularly as I am trying to move my projects to a one class per file so if I can remember the class name I can find the code file very quickly.</p>
<p>The &#8220;Quick File Navigation&#8221; dialog is accessible through the keyboard short cut Ctrl+Alt+F. Typing will filter the list box by the name of the file matching anywhere in the filename including the extension.</p>
<p>An additional feature for those who like me use CamelCase in their file names; if you enter your filter terms in capital letters it will search for capitalized words, in order within file names. Thus entering &#8220;AW&#8221; into the search box will also bring up the AboutWindow.cs in the above solution.</p>
<p>Combining the above with the Ctrl-G keyboard shortcut in Visual Studio 2008 to go to a specific line we can do the following to go to line 162 in ShipLoadoutSelectWindow.cs:</p>
<p><em>Ctrl+Alt+F  →  S,L,S,W  →  Ctrl+G →  1,6,2 </em></p>
<p>DevExpress have a great <a href="http://tv.devexpress.com/CodeRushXpress06Navigation.movie">training video</a> on their tv.devexpress.com sub site.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 225px; width: 1px; height: 1px;"><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p style="border: 1px solid #000000; padding: 0.05cm; margin-bottom: 0cm;"><span style="font-family: Calibri,sans-serif;">Ctrl+Alt+F  →  S,L,S,W  →  Ctrl+G →  1,6,2 </span></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.richard-slater.co.uk/archives/2009/10/12/find-files-in-coderush-xpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

