<?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; Programming</title>
	<atom:link href="http://www.richard-slater.co.uk/archives/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.richard-slater.co.uk</link>
	<description>Jesus, Life, Programming and Systems Administration</description>
	<lastBuildDate>Fri, 16 Jul 2010 21:04:06 +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>ASP.net 3.5 GridView RowCommand event fired twice</title>
		<link>http://www.richard-slater.co.uk/archives/2010/04/01/asp-net-3-5-gridview-rowcommand-event-fired-twice/</link>
		<comments>http://www.richard-slater.co.uk/archives/2010/04/01/asp-net-3-5-gridview-rowcommand-event-fired-twice/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 15:25:27 +0000</pubDate>
		<dc:creator>Richard Slater</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Sys. Admin.]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.richard-slater.co.uk/?p=763</guid>
		<description><![CDATA[I am writing this up to hopefully save someone else time in the future, this particular problem took up six hours of my day yesterday causing quite a bit of frustration for me, as the developer, and the users of the application. If you are searching for the solution scroll down to the bottom of [...]]]></description>
			<content:encoded><![CDATA[<p>I am writing this up to hopefully save someone else time in the future, this particular problem took up six hours of my day yesterday causing quite a bit of frustration for me, as the developer, and the users of the application.</p>
<p>If you are searching for the solution scroll down to the bottom of the page where I will outline the solution I used to resolve the problem. It is also worth pointing out that this does appear to be fixed in .NET 4. Certainly I was able to consistently reproduce the problem with VS2008/.NET 3.5 on multiple different computers. However after converting the project to VS2010/.NET 5 I haven&#8217;t seen the issue.</p>
<h1>Explanation of the problem</h1>
<p>I wrote and maintain an application that publishes a list of courses and allows users to book onto these courses, what I have listed below is a simplified version of this application.</p>
<p>The administration console contains two lists:</p>
<ul>
<li><strong>Published Courses</strong> &#8211; courses visible to all employees.</li>
<li><strong>Unpublished Courses </strong>- courses waiting to be published, only visible from the administration console.</li>
</ul>
<p>Courses can be freely published (i.e. moved from Unpublished to Published) by clicking green tick. Courses that have not had any bookings made can be unpublished by clicking the red cross.</p>
<p>The cross and the tick are implemented as <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx">GridView</a> <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.buttonfield.aspx">ButtonFields</a>:</p>
<pre>
</pre>
<pre><code>&lt;asp:ButtonField ButtonType="Image" CommandName="UnpublishCourse"
</code><code>    ImageUrl="~/images/unpublish.png" InsertVisible="False" Text="Unpublish" /&gt;
</code></pre>
<p><a href="http://www.richard-slater.co.uk/wp-content/uploads/2010/04/CourseBookings1.png"><img class="aligncenter size-medium wp-image-765" title="CourseBookings" src="http://www.richard-slater.co.uk/wp-content/uploads/2010/04/CourseBookings1-300x114.png" alt="" width="300" height="114" /></a></p>
<p>This application has been running for six months, the issue had not been observed up until yesterday. The user explained to me that when they were publishing courses they were always published in pairs, equally when unpublishing courses it was being done in pairs, concealingly unpublishing a course with bookings.</p>
<h1>Investigating the problem</h1>
<p>Initially I tried to reproduce this on my local machine, backed up and subsequently restored the database locally made sure I was running the same revision as the server and fired it up. Couldn&#8217;t reproduce the problem, no matter how fast I clicked it wouldn&#8217;t happen. Tried various permutations of code and database but could only reproduce on the server.</p>
<p>Refreshed the binaries on the server with the HEAD from subversion, problem was still happening most of the time. I confirmed that it wasn&#8217;t an issue with the stored procedures by running them manually through LinqPad.</p>
<p>I started putting debug statements at the entry points to the critical parts of the code, this yielded an interesting output on my development machine, each time the cross or the tick was clicked UnpublishedGridView_RowCommand was fired twice. This gave me something to search for, seems I am not the only one to have this problem, <a href="https://connect.microsoft.com/VisualStudio/feedback/details/102115/gridview-rowcommand-event-firing-twice">Microsoft tried to reproduce it in 2006</a> but couldn&#8217;t.</p>
<h1>Solving the problem</h1>
<p>As it turns out there are several ways of fixing the problem, several people have used timers to <a href="http://www.labbookpages.co.uk/electronics/debounce.html">&#8220;debounce&#8221;</a> the RowCommand event, assuming that the event is always going to be fired twice a session variable can be used to filter out the second event.</p>
<p>Because the event is only fired twice when ButtonType=&#8221;Image&#8221; not when ButtonType=&#8221;Link&#8221; you can set the text property to the HTML to render your image. This resulted in the code above becomming:</p>
<pre>
</pre>
<pre><code>&lt;asp:ButtonField ButtonType="Link" CommandName="UnpublishCourse"
</code><code>    InsertVisible="False" Text="&lt;img src=images/unpublish.png /&gt;" /&gt;
</code></pre>
<p>This proved to be the simplest possible solution, Visual Studio 2008 throws a warning about ASP.net validation, but I can live with that as long as the application works. In addition to the simplicity of the solution it also continues to work in ASP.net 4 (which doesn&#8217;t exhibit the double event behaviour).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richard-slater.co.uk/archives/2010/04/01/asp-net-3-5-gridview-rowcommand-event-fired-twice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LINQPad Crash</title>
		<link>http://www.richard-slater.co.uk/archives/2010/03/02/linqpad-crash/</link>
		<comments>http://www.richard-slater.co.uk/archives/2010/03/02/linqpad-crash/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 21:48:18 +0000</pubDate>
		<dc:creator>Richard Slater</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Crash]]></category>
		<category><![CDATA[Exception]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[LINQPad]]></category>

		<guid isPermaLink="false">http://www.richard-slater.co.uk/?p=746</guid>
		<description><![CDATA[Update: I never did &#8220;fix&#8221; this problem, installing .NET 4 then using LINQPad 4 seems to work well. I found myself using LINQPad more often than creating console applications, so much so I dicided to make the small but worth while investment in the optional &#8220;Autocompletion&#8221; (Intelisense-like) component. The licence is great because I can have [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color: #ff0000;">Update:</span> I never did &#8220;fix&#8221; this problem, installing .NET 4 then using LINQPad 4 seems to work well.</strong></p>
<p>I found myself using <a href="http://www.linqpad.net/">LINQPad</a> more often than creating console applications, so much so I dicided to make the small but worth while investment in the optional &#8220;Autocompletion&#8221; (Intelisense-like) component. The licence is great because I can have it installed on all three of my PCs without having to buy extra licences.</p>
<p>I was figuring out the limits of the Math.Pow function a few days ago on the laptop when the LINQPad upgrade message appeared, not sure what happened next because LINQPad crashed with the following exception.</p>
<p><strong>System Specification:</strong></p>
<ul>
<li>Windows 7 Home Premium x64</li>
<li>.NET v2.0.50727 (+3.0 &amp; 3.5)</li>
<li>.NET v4.0.20506</li>
<li>VisualStudio 2010 Beta1</li>
</ul>
<pre>System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at LINQPad.Program.ProcessException(Exception ex)
   at LINQPad.Program.Start(String[] args)
   at LINQPad.ProgramStarter.Run(String[] args)
   at LINQPad.Loader.Main(String[] args)</pre>
<p>If anyone has any theories as to how this can be fixed I would be very apprecitive if you could post in the comments.</p>
<p>So far I have tried:</p>
<ul>
<li>Reinstalling from the latest (2.10.1)<strong> </strong>from the LINQPad website.</li>
<li>Restarted the computer.</li>
<li>Removing LINQPad through Add/Remove Programs.</li>
<li>Remove LINQPAD manually.</li>
<li>Rename %APPDATA%\LINQPad.</li>
<li>Looked for Native Images in C:\Windows\assembly &#8211; None there</li>
</ul>
<p>It seems to me that LINQPad throws some exception, which it&#8217;s built in exception handler tries to handle then fails, this probably means that the above stack trace is probably not indicative of what is causing the problem. Not that I think it will make a difference but I am going to try upgrading to Visual Studio 2010 RC tomorrow then at least I wll be able to use LINQPad for .NET 4.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richard-slater.co.uk/archives/2010/03/02/linqpad-crash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preventing the PictureBox control from locking files</title>
		<link>http://www.richard-slater.co.uk/archives/2010/02/28/preventing-the-picturebox-control-from-locking-files/</link>
		<comments>http://www.richard-slater.co.uk/archives/2010/02/28/preventing-the-picturebox-control-from-locking-files/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 20:18:58 +0000</pubDate>
		<dc:creator>Richard Slater</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[EVEMon]]></category>

		<guid isPermaLink="false">http://www.richard-slater.co.uk/?p=739</guid>
		<description><![CDATA[One of our more regular contributors to EVEMon posted on our forums showing that the application was incapable of updating cached files (specifically images), after a bit testing I discovered the following Exception was being thrown when trying to overwrite the file in question: System.IO.IOException: The process cannot access the file 'path\filename' because it is [...]]]></description>
			<content:encoded><![CDATA[<p>One of our more regular contributors to <a href="http://evemon.battleclinic.com/">EVEMon</a> posted on our forums showing that the application was incapable of updating cached files (specifically images), after a bit testing I discovered the following Exception was being thrown when trying to overwrite the file in question:</p>
<pre>System.IO.IOException: The process cannot access the file 'path\filename' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
   at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
   at EVEMon.Common.FileHelper.OverwriteOrWarnTheUser(String srcFileName, String destFileName) in EVEMon.Common\FileHelper.cs:line 108
   at EVEMon.Common.FileHelper.OverwriteOrWarnTheUser(String destFileName, Func`2 writeContentFunc) in EVEMon.Common\FileHelper.cs:line 82
   at EVEMon.Common.Controls.CharacterPortrait.SavePortraitToCache(Image newImage) in EVEMon.Common\Controls\CharacterPortrait.cs:line 248
</pre>
<p>After a bit of searching around I discovered a <a href="http://stackoverflow.com/questions/2188464/net-app-locks-file">post on StackOverflow</a> identifying that System.Drawing.Bitmap(string filename) would lock the filename until the Bitmap was disposed of. The post presented a solution but no code, A bit of further searching confirmed my expectation that <a href="http://msdn.microsoft.com/en-us/library/4sahykhd.aspx">Image.FromFile(string filename)</a> was subject to the same locking behaviour:</p>
<blockquote><p>The file remains locked until the <a id="ctl00_MTCS_main_ctl51_ctl00_ctl00" onclick="javascript:Track('ctl00_MTCS_main_ctl51_ctl00_contenthere|ctl00_MTCS_main_ctl51_ctl00_ctl00',this);" href="http://msdn.microsoft.com/en-us/library/system.drawing.image.aspx">Image</a> is disposed.</p></blockquote>
<p>A bit more searching identified another <a href="http://stackoverflow.com/questions/542217/load-a-bitmapsource-and-save-using-the-same-name-in-wpf-ioexception">post on StackOverflow</a> which gave me the basic syntax and structure for the code I was going to need to implement this in EVEMon. The final code looks like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>189
190
191
192
193
194
195
196
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;">MemoryStream stream <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> MemoryStream<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #FF0000;">byte</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> imageBytes <span style="color: #008000;">=</span> File.<span style="color: #0000FF;">ReadAllBytes</span><span style="color: #000000;">&#40;</span>cacheFileName<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
stream.<span style="color: #0000FF;">Write</span><span style="color: #000000;">&#40;</span>imageBytes, <span style="color: #FF0000;">0</span>, imageBytes.<span style="color: #0000FF;">Length</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
stream.<span style="color: #0000FF;">Position</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span>
&nbsp;
var image <span style="color: #008000;">=</span> Image.<span style="color: #0000FF;">FromStream</span><span style="color: #000000;">&#40;</span>stream<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">return</span> image<span style="color: #008000;">;</span></pre></td></tr></table></div>

<p>It appears that GDI+ will lock any image that is loaded into a control in WinForms and WPF, several comments on StackOverflow and byte.com suggested that even disposing of the control and the FileStream was not a reliable way of being able to write to the file so the above method is seems to be be the best solution all round.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richard-slater.co.uk/archives/2010/02/28/preventing-the-picturebox-control-from-locking-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Controling Code Outlining with the Keyboard</title>
		<link>http://www.richard-slater.co.uk/archives/2009/11/03/controling-code-outlining-with-the-keyboard/</link>
		<comments>http://www.richard-slater.co.uk/archives/2009/11/03/controling-code-outlining-with-the-keyboard/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 19:13:35 +0000</pubDate>
		<dc:creator>Richard Slater</dc:creator>
				<category><![CDATA[CodeRush]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.richard-slater.co.uk/?p=702</guid>
		<description><![CDATA[Code outlining is a feature of supported by Visual Studio and many other editors, MSDN has some good documentation for VS2005, VS2008 and VS2010. If I were asked to explain this as briefly as possible, I would probably say: Code Outlining is the logical partitioning of code in such a way that the user interface, [...]]]></description>
			<content:encoded><![CDATA[<p>Code outlining is a feature of supported by Visual Studio and many other editors, MSDN has some good documentation for <a href="http://msdn.microsoft.com/en-us/library/td6a5x4s(VS.80).aspx">VS2005</a>, <a href="http://msdn.microsoft.com/en-us/library/td6a5x4s.aspx">VS2008 </a>and <a href="http://msdn.microsoft.com/en-us/library/td6a5x4s(VS.100).aspx">VS2010</a>. If I were asked to explain this as briefly as possible, I would probably say:</p>
<blockquote><p>Code Outlining is the logical partitioning of code in such a way that the user interface, or editor, is able to selectively hide the body of the content (such as a class, struct, enum or method) whilst leaving the signature or some identifying comment visible.</p></blockquote>
<p>You can see this in action in Visual Studio 2008 with the following Screenshot:</p>
<p><img class="alignnone size-full wp-image-705" title="CodeOutliningVS2008" src="http://www.richard-slater.co.uk/wp-content/uploads/2009/11/CodeOutliningVS2008.png" alt="CodeOutliningVS2008" width="500" height="295" /></p>
<p>I accidentally turned off Code Outlining today by hitting some keyboard shortcut that I didn&#8217;t know how to reverse, this lead me to discover several useful keyboard shortcuts for managing the display of your code from the keyboard.</p>
<p>As it turns out I managed to hit Ctrl-M followed by Ctrl-P (or just P in fact) which maps to Edit.StopOutlining, by default it seems that the Visual C# 2005 mapping scheme doesn&#8217;t provide a shortcut to enable Automatic Outlining so instead you can access the command through Edit Menu -&gt; Outlining -&gt; Start Automatic Outlining.</p>
<p>Enabled again, I get to play with code outlining from the keyboard:</p>
<ul>
<li>To toggle (collapse an expanded block or expand a collapsed block) the closest outlined element use Ctrl-M followed by Ctrl-M.</li>
<li>To toggle everything use Ctrl-M followed by Ctrl-L (I find little use for this)</li>
<li>To collapse to definitions use Ctrl-M followed by Ctrl-O</li>
</ul>
<p>The last one is the most useful when used in conjunction with <a href="http://msdn.microsoft.com/en-us/library/9a1ybwek.aspx">Regions</a> as after colapsing to definitions you will get something similar to this:</p>
<p><img class="alignnone size-full wp-image-706" title="ColapseToDefinitionsVS2008" src="http://www.richard-slater.co.uk/wp-content/uploads/2009/11/ColapseToDefinitionsVS2008.png" alt="ColapseToDefinitionsVS2008" width="555" height="389" /></p>
<p>You might have noticed in the first screenshot that CodeRush Xpress adds a coloured line between the beginning and end of blocks of code, this is a nice feature if you have long blocks of code, which of course you shouldn&#8217;t have.</p>
<p><img class="alignnone size-full wp-image-707" title="CodeRushXpressBlockLines" src="http://www.richard-slater.co.uk/wp-content/uploads/2009/11/CodeRushXpressBlockLines.png" alt="CodeRushXpressBlockLines" width="70" height="107" /></p>
<p>There we go, an errant key stroke can lead to learning and blogging, who would have thought it?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richard-slater.co.uk/archives/2009/11/03/controling-code-outlining-with-the-keyboard/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>
