<?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>Juan Wajnerman &#187; Visual Studio</title>
	<atom:link href="http://weblogs.manas.com.ar/waj/category/visual-studio/feed/" rel="self" type="application/rss+xml" />
	<link>http://weblogs.manas.com.ar/waj</link>
	<description></description>
	<lastBuildDate>Wed, 05 Aug 2009 23:51:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Automatic &#8216;Organize Usings&#8217; when saving files on VS2008</title>
		<link>http://weblogs.manas.com.ar/waj/2007/12/01/automatic-organize-usings-when-saving-files-on-vs2008/</link>
		<comments>http://weblogs.manas.com.ar/waj/2007/12/01/automatic-organize-usings-when-saving-files-on-vs2008/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 06:44:52 +0000</pubDate>
		<dc:creator>Juan Wajnerman</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://weblogs.manas.com.ar/waj/2007/12/01/automatic-organize-usings-when-saving-files-on-vs2008/</guid>
		<description><![CDATA[I really love this new feature of VS2008 that allows you to cleanup the &#8216;usings&#8217; section of C# files (and I&#8217;ve been always missing this from Eclipse) but I was a bit disappointed when I found there is no choice to execute automatically before every save. Somebody please tell me if I&#8217;m wrong! As I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>I really love this new feature of VS2008 that allows you to cleanup the &#8216;usings&#8217; section of C# files (and I&#8217;ve been always missing this from Eclipse) but I was a bit disappointed when I found there is no choice to execute automatically before every save. Somebody please tell me if I&#8217;m wrong!<br />
As I&#8217;m little paranoid I wrote this simple macro and reassigned the &#8216;CTRL+S&#8217; shortcut to it. The try/catch is needed because it will fail with no C# editors.</p>
<pre>
Public Sub RemoveSortAndSaveSelectedItems()
    Try
        DTE.ExecuteCommand("Edit.RemoveAndSort")
    Catch
    End Try
    DTE.ExecuteCommand("File.SaveSelectedItems")
End Sub
</pre>
<p>Now this will be on my list of the very first things to do when reinstalling a development machine <img src='http://weblogs.manas.com.ar/waj/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://weblogs.manas.com.ar/waj/2007/12/01/automatic-organize-usings-when-saving-files-on-vs2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
