<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicio.us/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Hadi Hariri : ReSharper</title><link>http://devlicio.us/blogs/hadi_hariri/archive/tags/ReSharper/default.aspx</link><description>Tags: ReSharper</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Providing Intellisense, Navigation and more for Custom Helpers in ASP.NET MVC</title><link>http://devlicio.us/blogs/hadi_hariri/archive/2011/12/07/providing-intellisense-navigation-and-more-for-custom-helpers-in-asp-net-mvc.aspx</link><pubDate>Wed, 07 Dec 2011 13:47:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68809</guid><dc:creator>Hadi Hariri</dc:creator><slash:comments>19</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/hadi_hariri/rsscomments.aspx?PostID=68809</wfw:commentRss><comments>http://devlicio.us/blogs/hadi_hariri/archive/2011/12/07/providing-intellisense-navigation-and-more-for-custom-helpers-in-asp-net-mvc.aspx#comments</comments><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You probably are aware by now that as of ReSharper 5 we added first-class support for ASP.NET MVC. This included among many things, the ability to provide Intellisense, Create from usage and Navigation to built-in methods such as &lt;i&gt;Controller.View &lt;/i&gt;or &lt;i&gt;Html.ActionLink&lt;/i&gt;:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;Navigation&lt;/h4&gt;
&lt;p&gt;Ctrl+Left Mouse Click or F12 will navigate to the corresponding View&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image:none;border-right-width:0px;margin:10px 0px 0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_0D6522DB.png" border="0" height="257" width="567" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;or to the Action and/or Controller&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image:none;border-right-width:0px;margin:10px 0px 0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_27C515F2.png" border="0" height="130" width="650" /&gt;&lt;/p&gt;
&lt;h4&gt;Intellisense and Create From Usage&lt;/h4&gt;
&lt;p&gt;Ability to have Intellisense when providing Actions/Controllers &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image:none;border-right-width:0px;margin:10px 0px 0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_2A8ACAE5.png" border="0" height="98" width="600" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;as well as the possibility of creating from usage&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image:none;border-right-width:0px;margin:10px 0px 0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_709B87F8.png" border="0" height="208" width="729" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, what happens when you want to use a custom function, for instance, a better ActionLink or your own View method? Did you know that you can still get all these goodies? All you need to do is use some Annotations.&lt;/p&gt;
&lt;h3&gt;Using JetBrains.Annotations&lt;/h3&gt;
&lt;p&gt;ReSharper uses annotations via the form of .NET attributes to figure out what an ASP.NET MVC View, Action or Controller is. As such, all we need to do for our custom method and extensions to leverage this, is tell ReSharper what parameter corresponds to what. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;Referencing the annotations&lt;/h4&gt;
&lt;p&gt;To use ReSharper annotations, we have mainly two options (with a third one hopefully coming soon):&lt;/p&gt;
&lt;p&gt;1. We can include the library JetBrains.Annotations.dll in our project and reference it.&lt;/p&gt;
&lt;p&gt;2. We can copy the annotations and include it as source in our project&lt;/p&gt;
&lt;p&gt;&lt;i&gt;[3. We can use nuget install-package JetBrains.Annotations] Coming soon!&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The first option is pretty simple. The DLL is located in the ReSharper installation &lt;i&gt;bin &lt;/i&gt;folder. For the second option, we open up &lt;b&gt;ReSharper | Options &lt;/b&gt;and select &lt;b&gt;Code Annotations&lt;/b&gt; entry&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image:none;border-right-width:0px;margin:10px 0px 0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_7D293514.png" border="0" height="448" width="583" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;select the &lt;b&gt;Copy default implementation to clipboard &lt;/b&gt;button and paste into an empty file. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;Annotating custom methods&lt;/h4&gt;
&lt;p&gt;Once we&amp;rsquo;ve completed this step, all we need to do is annotate our parameters with the correct attributes. We&amp;rsquo;re interested in 3 different attributes in particular:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;AspMvcView&lt;/b&gt; which indicates the parameter is a View &lt;/li&gt;
&lt;li&gt;&lt;b&gt;AspMvcAction&lt;/b&gt; which indicates the parameter is an Action &lt;/li&gt;
&lt;li&gt;&lt;b&gt;AspMvcController&lt;/b&gt; which indicates the parameter is a Controller &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here is the header corresponding to a base controller with a custom method named &lt;i&gt;ExtendedView &lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image:none;border-right-width:0px;margin:10px 0px 0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_46D80D05.png" border="0" height="117" width="345" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;and here&amp;rsquo;s the header for a custom ActionLink &lt;/p&gt;
&lt;p&gt;&lt;img style="background-image:none;border-right-width:0px;margin:10px 0px 0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_21DA4C8C.png" border="0" height="185" width="660" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;(the body of both methods are omitted and are not necessary to demonstrate the functionality)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As soon as we do this, ReSharper picks up these methods and offers us the same functionality that is provided for the methods that ship out of the box:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image:none;border-right-width:0px;margin:10px 0px 0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_64D61AF9.png" border="0" height="158" width="642" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Notice how we still get Navigation (the underlining), Intellisense and Create from usage in our &lt;i&gt;TheOnlyActionLink &lt;/i&gt;custom method. Its much the same for the &lt;i&gt;ExtendedView &lt;/i&gt;method&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image:none;border-right-width:0px;margin:10px 0px 0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_3199E190.png" border="0" height="128" width="501" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s all there is to it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68809" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/Tools/default.aspx">Tools</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/ReSharper/default.aspx">ReSharper</category></item><item><title>YouTrackSharp and YouTrackForReSharper on JetBrains GitHub</title><link>http://devlicio.us/blogs/hadi_hariri/archive/2011/08/17/youtracksharp-and-youtrackforresharper-on-jetbrains-github.aspx</link><pubDate>Wed, 17 Aug 2011 14:38:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68115</guid><dc:creator>Hadi Hariri</dc:creator><slash:comments>12</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/hadi_hariri/rsscomments.aspx?PostID=68115</wfw:commentRss><comments>http://devlicio.us/blogs/hadi_hariri/archive/2011/08/17/youtracksharp-and-youtrackforresharper-on-jetbrains-github.aspx#comments</comments><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Just a quick note to say that I&amp;rsquo;ve transferred the YouTrackSharp project from my own account over to the &lt;a href="http://github.com/JetBrains"&gt;JetBrains account on github&lt;/a&gt;. I&amp;rsquo;ve also pushed the initial spike of &lt;a href="http://github.com/JetBrains/YouTrackForReSharper"&gt;YouTrackForReSharper&lt;/a&gt; which is a plug-in for &lt;a href="http://www.jetbrains.com/resharper"&gt;ReSharper&lt;/a&gt; to talk to YouTrack. We&amp;rsquo;re looking for contributors for this project, so if you&amp;rsquo;re up to it, fork away!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68115" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/Tools/default.aspx">Tools</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/ReSharper/default.aspx">ReSharper</category></item><item><title>Machine.Specifications for ReSharper 6 now available</title><link>http://devlicio.us/blogs/hadi_hariri/archive/2011/07/20/machine-specifications-for-resharper-6-now-available.aspx</link><pubDate>Wed, 20 Jul 2011 14:16:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68008</guid><dc:creator>Hadi Hariri</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/hadi_hariri/rsscomments.aspx?PostID=68008</wfw:commentRss><comments>http://devlicio.us/blogs/hadi_hariri/archive/2011/07/20/machine-specifications-for-resharper-6-now-available.aspx#comments</comments><description>&lt;p&gt;Many, myself included, have been eagerly awaiting the release of the ReSharper Runner of Machine.Specification (MSpec) for ReSharper 6. I&amp;rsquo;m glad to announce that this is now available, which is the result of a team-effort between &lt;a href="http://twitter.com/kropp"&gt;Victor Kropp&lt;/a&gt;, &lt;a href="http://twitter.com/#!/lucisferre"&gt;Chris Nicola&lt;/a&gt;, myself and of course &lt;a href="http://twitter.com/#!/agross"&gt;Alexander Gross&lt;/a&gt;, long-time contributor and main maintainer of the MSpec project. &lt;/p&gt;
&lt;p&gt;NuGet packages have already been updated to support ReSharper 6. The source code can also be obtained via &lt;a href="http://www.symbolsource.org/"&gt;SymbolSource.org&lt;/a&gt; if using NuGet or directly from &lt;a href="https://github.com/agross/machine.specifications"&gt;Alexander&amp;rsquo;s GitHub account&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/SNAGHTML5fd19d5_5F00_5FA3ABE7.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin:10px 0px 0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="SNAGHTML5fd19d5" alt="SNAGHTML5fd19d5" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/SNAGHTML5fd19d5_5F00_thumb_5F00_03102A80.png" border="0" height="324" width="753" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Installing the Runner in ReSharper 6&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re new to MSpec or have simply forgotten how to install the runner under ReSharper, here are some simple steps to use Mspec in your project and integrate it with ReSharper:&lt;/p&gt;
&lt;p&gt;&lt;b&gt;1&lt;/b&gt;. Run the command &lt;i&gt;install-package&lt;/i&gt; &lt;b&gt;Machine.Specifications &lt;/b&gt;(or &lt;b&gt;Machine.Specifications-Signed&lt;/b&gt; if you want the signed version). If this is an existing project, issue the command &lt;i&gt;update-package &lt;/i&gt;instead of &lt;i&gt;install-package&lt;/i&gt;.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;2&lt;/b&gt;. Inside the packages folder corresponding to Machine.Specifications, a &lt;i&gt;tools&lt;/i&gt; folder is created with a series of assemblies and some batch files. There are a series of batch files named InstallResharperRunner.X.X. &amp;ndash; VS20XX.bat where X&amp;rsquo;s correspond to the version of ReSharper and of Visual Studio. By executing the corresponding one, it will copy the assemblies to the ReSharper plug-in folder. &lt;/p&gt;
&lt;p&gt;You can of course do the second step manually, by copying the Machine.Specifications.ReSharperRunner.X.Y files to the ReSharper Plugins folder, located either under the ReSharper bin folder in %Program Files%\JetBrains\ReSharperX\bin (for all users) or under %APPDATA%\JetBrains\ReSharperX\bin (user-specific settings).&lt;/p&gt;
&lt;p&gt;With that you should be up and running.&lt;/p&gt;
&lt;p&gt;Enjoy.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68008" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/Tools/default.aspx">Tools</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/ReSharper/default.aspx">ReSharper</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/MSpec/default.aspx">MSpec</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/Testing/default.aspx">Testing</category></item><item><title>Writing plug-ins for ReSharper: Part 2 of N</title><link>http://devlicio.us/blogs/hadi_hariri/archive/2010/07/20/writing-plug-ins-for-resharper-part-2-of-n.aspx</link><pubDate>Tue, 20 Jul 2010 21:02:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:61155</guid><dc:creator>Hadi Hariri</dc:creator><slash:comments>14</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/hadi_hariri/rsscomments.aspx?PostID=61155</wfw:commentRss><comments>http://devlicio.us/blogs/hadi_hariri/archive/2010/07/20/writing-plug-ins-for-resharper-part-2-of-n.aspx#comments</comments><description>&lt;p&gt;[Finally I&amp;rsquo;ve managed to get the second part of the post on plug-ins. Sorry for the delay to everyone who was waiting. Appreciate your patience.&amp;nbsp; And now I&amp;rsquo;ll resume my holidays!]&lt;/p&gt;
&lt;p&gt;In the &lt;a href="http://devlicio.us/blogs/hadi_hariri/archive/2010/01/12/writing-plug-ins-for-resharper-part-1-of-undefined.aspx"&gt;previous part of this series&lt;/a&gt;, we saw the basics of how to create a plug-in for &lt;a href="http://www.jetbrains.com/resharper"&gt;ReSharper&lt;/a&gt;, install it and run it. We created a context action that would allow us to mark a public method as virtual (where applicable). However, this was done as an explicit action by the user, as such, you didn&amp;rsquo;t get any kind of hint or suggestion to do this. What we want to do now is make this a hint, so that highlighting appears under methods that could be made virtual. In this part we are going to expand on the same plug-in and convert it into a &lt;i&gt;QuickFix&lt;/i&gt;. &lt;/p&gt;
&lt;h3&gt;What is a &lt;i&gt;QuickFix?&lt;/i&gt;&lt;/h3&gt;
&lt;p&gt;Have you seen the little squiggly lines that appear in Visual Studio? &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_18E8B29B.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_6EB904B2.png" border="0" height="162" width="326" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;They usually indicate a Suggestion (field can be made read-only), Warning (possible null reference) or Error. ReSharper analyzes and can detect potential issues in the code (similar to what static checker of Code Contracts does). These are known as Highlights and they are related to QuickFixes in that usually a highlight has an &lt;b&gt;QuickFix&lt;/b&gt; associated to it, which invokes a context action. This is usually done by placing the cursor on top of the highlighting and press Alt+Enter&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_76ED2A49.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_09C1ADF4.png" border="0" height="116" width="403" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Highlighting Daemons&lt;/h3&gt;
&lt;p&gt;In the gutter of the Visual Studio editor (right-side), ReSharper displays a series of warnings, errors and hints, which indicate potential issues on a specific file. These issues are detected by background processes known as Daemons. Since what we are looking for is for ReSharper to warn us of existing methods that could be made virtual, what we need to do is somehow hook into these daemons. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_404F5938.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;margin-left:0px;border-left-width:0px;margin-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_37131DF7.png" border="0" height="244" width="65" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Step by Step Guide&lt;/h3&gt;
&lt;p&gt;The Daemons in ReSharper use the Visitor pattern to use act on elements, be it code, files, etc. The first step is to implement an &lt;b&gt;IDaemonStage &lt;/b&gt;interface, which hold metadata about our daemon stage at at the same time acts as a factory for the actual process we are implementing. &lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:862f1f96-7fa7-42fd-b72d-f48172f17579" class="wlWriterEditableSmartContent"&gt;
&lt;div class="le-pavsc-container"&gt;
&lt;div style="background-color:#000000;overflow:auto;padding:2px 5px;white-space:nowrap;"&gt;&lt;span style="color:#ffffff;"&gt;[&lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;DaemonStage&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(StagesBefore = &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;new&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;[]&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;typeof&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;LanguageSpecificDaemonStage&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;) })]&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;class&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;MakeMethodVirtualDaemonStage&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;: &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;IDaemonStage&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;IDaemonStageProcess&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; CreateProcess(&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;IDaemonProcess&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; process, &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;DaemonProcessKind&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; processKind)&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;return&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;new&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;MakeMethodVirtualDaemonStageProcess&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(process);&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;ErrorStripeRequest&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; NeedsErrorStripe(&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;IProjectFile&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; projectFile)&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;return&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;ErrorStripeRequest&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;.STRIPE_AND_ERRORS;&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;There are two main methods to implement. The &lt;b&gt;CreateProcess &lt;/b&gt;is what creates the actual process for us and the &lt;b&gt;NeedsErrorStrip &lt;/b&gt;which indicates whether this daemon uses the gutter to display strips. The &lt;b&gt;DaemonProcessKind&lt;/b&gt; parameter passed into the first method helps us discriminate on when this process should be executed, i.e. only during checking of visible (current) document, during solution wide analysis, etc.&lt;/p&gt;
&lt;p&gt;The next step is to implement the process via the &lt;b&gt;IDaemonStageProcess &lt;/b&gt;interface:&lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:41371a43-10bb-4def-b308-70fb9a66784d" class="wlWriterEditableSmartContent"&gt;
&lt;div class="le-pavsc-container"&gt;
&lt;div style="background-color:#000000;overflow:auto;padding:2px 5px;white-space:nowrap;"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;class&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;MakeMethodVirtualDaemonStageProcess&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; : &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;IDaemonStageProcess&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;readonly&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;IDaemonProcess&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; _process;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; MakeMethodVirtualDaemonStageProcess(&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;IDaemonProcess&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; process)&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;_process = process;&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;void&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; Execute(&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;Action&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;DaemonStageResult&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;&amp;gt; commiter)&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;if&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; (_process.InterruptFlag)&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;return&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;;&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;var&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; file = _process.ProjectFile.GetPsiFile(&lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;CSharpLanguageService&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;.CSHARP) &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;as&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;ICSharpFile&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;if&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; (file != &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;null&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;)&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;var&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; highlights = &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;new&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;List&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;HighlightingInfo&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;&amp;gt;();&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;var&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; processor = &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;new&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;RecursiveElementProcessor&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;IMethodDeclaration&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;&amp;gt;(declaration =&amp;gt;&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;var&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; accessRights = declaration.GetAccessRights();&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;if&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; (accessRights == &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;AccessRights&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;.PUBLIC &amp;amp;&amp;amp; !declaration.IsStatic &amp;amp;&amp;amp; !declaration.IsVirtual &amp;amp;&amp;amp;&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;!declaration.IsOverride)&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;var&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; docRange = declaration.GetNameDocumentRange();&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;highlights.Add(&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;new&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;HighlightingInfo&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(docRange, &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;new&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;MakeMethodVirtualSuggestion&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(declaration)));&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;});&lt;/span&gt;&lt;br /&gt; &lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;file.ProcessDescendants(processor);&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;commiter(&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;new&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;DaemonStageResult&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(highlights));&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The main meat of this class is in the &lt;b&gt;Execute &lt;/b&gt;method. We first check to make sure that we&amp;rsquo;ve not received an interruption (Interrupt Flag raised) due to some external action. Next step is to get access to the current file (remember that we are visiting the entire visible document, not just a specific method). Having the file, we can now create a &lt;b&gt;RecusiveElementProcessor*&lt;/b&gt; to perform a tree walk of the AST and perform the specific action on each element. The action to perform is declared as the lambda expression. Since we&amp;rsquo;re interested in the method declaration, the type is &lt;b&gt;IMethodDeclaration&lt;/b&gt; (there are many others). If we look at the expression, we can see that it&amp;rsquo;s pretty much the same as that of &lt;a href="http://hadihariri.com/blogengine/post/2010/01/12/Writing-plug-ins-for-ReSharper-Part-1-of-Undefined.aspx"&gt;Part 1&lt;/a&gt;, the only difference is that we add the results to the highlighting variable. &lt;/p&gt;
&lt;p&gt;The &lt;b&gt;HighlightingInfo &lt;/b&gt;class has a parameter which can be a Suggestion, Warning or Error, as explained previously. Since in our case we need a suggestion, we pass in the &lt;b&gt;MakeMethodVirtualSuggestion&lt;/b&gt;:&lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:781a1c96-7177-497a-94aa-8aca6403e14a" class="wlWriterEditableSmartContent"&gt;
&lt;div class="le-pavsc-container"&gt;
&lt;div style="background-color:#000000;overflow:auto;padding:2px 5px;white-space:nowrap;"&gt;&lt;span style="color:#ffffff;"&gt;[&lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;StaticSeverityHighlighting&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;Severity&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;.SUGGESTION)]&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;class&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;MakeMethodVirtualSuggestion&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; : &lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;CSharpHighlightingBase&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;, &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;IHighlighting&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;ICSharpTypeMemberDeclaration&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; Declaration { &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;get&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;private&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;set&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;; }&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; MakeMethodVirtualSuggestion(&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;ICSharpTypeMemberDeclaration&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; memberDeclaration)&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;Declaration = memberDeclaration;&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;string&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; ToolTip&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;get&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; { &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;return&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#a5c25c;"&gt;&amp;quot;Method could be marked as virtual&amp;quot;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;; }&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;string&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; ErrorStripeToolTip&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;get&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; { &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;return&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; ToolTip; }&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;override&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;bool&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; IsValid()&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;return&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; Declaration.IsValid();&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;int&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; NavigationOffsetPatch&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;get&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; { &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;return&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;0&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;; }&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This class is pretty simple. The main property to define is the &lt;b&gt;ToolTip&lt;/b&gt;, which is the text that will show when we hover of the highlighting. The &lt;b&gt;ErrorStripeToolTip&lt;/b&gt; is what&amp;rsquo;s displayed in the right-hand side gutter. Finally the Attribute &lt;b&gt;StaticSeverityHighlighting &lt;/b&gt;is to indicate what type of tip it is (Warning, Error, etc.). &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[*Note: In this case, the operation we want to perform is very simple. If we want a more complex scenario where we need to do some processing before and after each element is visited or have a more fine-grained control, we can implement the &lt;b&gt;IRecurisveElementProcessor&lt;/b&gt;. I&amp;rsquo;ll cover this in another post].&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To recap, right now we would have everything place to display highlighting when a method that could be made virtual is encountered. The only remaining part is to now be able to apply a &lt;b&gt;QuickFix&lt;/b&gt;. This is in many ways similar to the ContextAction we saw in &lt;a href="http://hadihariri.com/blogengine/post/2010/01/12/Writing-plug-ins-for-ReSharper-Part-1-of-Undefined.aspx"&gt;Part 1&lt;/a&gt;:&lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:9e844366-abb3-4116-887f-dfcbfb826cf0" class="wlWriterEditableSmartContent"&gt;
&lt;div class="le-pavsc-container"&gt;
&lt;div style="background-color:#000000;overflow:auto;padding:2px 5px;white-space:nowrap;"&gt;&lt;span style="color:#ffffff;"&gt;[&lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;QuickFix&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;]&lt;/span&gt;&lt;br /&gt; &lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;class&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;MakeMethodVirtualQuickFix&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; : &lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;BulbItemImpl&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;, &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;IQuickFix&lt;/span&gt;&lt;br /&gt; &lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;readonly&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;MakeMethodVirtualSuggestion&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; _highlighter;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#808080;"&gt;// Takes as parameter the Highlighter the quickfix refers to&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; MakeMethodVirtualQuickFix(&lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;MakeMethodVirtualSuggestion&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; highlighter)&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;_highlighter = highlighter;&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#808080;"&gt;// In the transaction we make the necessary changes to the code&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;protected&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;override&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;Action&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;ITextControl&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;&amp;gt; ExecuteTransaction(&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;ISolution&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; solution, &lt;/span&gt;&lt;span style="color:#6897bb;"&gt;IProgressIndicator&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; progress)&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;_highlighter.Declaration.SetVirtual(&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;true&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;);&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;return&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;null&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;;&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#808080;"&gt;// Text that appears in the context menu&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;override&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;string&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; Text&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;get&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; { &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;return&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#a5c25c;"&gt;&amp;quot;Make Method Virtual&amp;quot;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;; }&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#808080;"&gt;// Indicates when the option is available &lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;bool&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; IsAvailable(&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;IUserDataHolder&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; cache)&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;return&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; _highlighter.IsValid();&lt;/span&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;br /&gt; &lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;b&gt;MakeMethodVirtualQuickFix &lt;/b&gt;needs to implement the &lt;b&gt;IBulbItem &lt;/b&gt;and &lt;b&gt;IQuickFix &lt;/b&gt;interfaces. For ease of implementation we can inherit from &lt;b&gt;BulbItemImpl&lt;/b&gt;. The constructor should take as parameter always the actual highlighting that has given way to invoking the QuickFix, in our case the &lt;b&gt;MakeMethodVirtualSuggestion&lt;/b&gt;. Similar to the ContextAction we implemented in &lt;a href="http://hadihariri.com/blogengine/post/2010/01/12/Writing-plug-ins-for-ReSharper-Part-1-of-Undefined.aspx"&gt;Part 1&lt;/a&gt;, the actual fix itself is pretty trivial. All we need to do is make the method virtual. How do we get access to the method? The easiest way is via the Declaration property of the highlighting passed in (this is a property we added before). The only thing left is to call the &lt;b&gt;SetVirtual &lt;/b&gt;method on it. Since we are in the &lt;b&gt;ExecuteTransaction &lt;/b&gt;method, ReSharper makes sure that any change made is executed as a whole. &lt;/p&gt;
&lt;p&gt;The rest of the properties are trivial. Text returns the text of the QuickFix (what appears in the menu), and &lt;b&gt;IsAvailable&lt;/b&gt; indicates when the &lt;b&gt;QuickFix&lt;/b&gt; is available, which in our case is whenever the highlighting is valid. &lt;/p&gt;
&lt;h3&gt;&amp;nbsp;&lt;/h3&gt;
&lt;h3&gt;The End Result&lt;/h3&gt;
&lt;p&gt;Once we compile the plug-in and place it in the corresponding Plugins folder under ReSharper\Bin, we&amp;rsquo;re done. Here&amp;rsquo;s the end result:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_0E2808EE.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_2168BF8D.png" border="0" height="124" width="400" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;and invoking Alt+Enter on the highlighting gives us:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_2A091819.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_479AF318.png" border="0" height="185" width="399" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;Extending ReSharper to create highlightings and quick fixes is pretty simple once you understand how all the pieces fall into place. Most of the code will usually be the same and what will vary will be the actual element processing to be performed and the corresponding QuickFix. As mentioned previously (in the Note), for complex scenarios, we can have more control over the tree walk and that&amp;rsquo;s something we&amp;rsquo;ll examine in a future post.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve placed the code up on my &lt;a href="http://github.com/hhariri"&gt;github account&lt;/a&gt; so feel free to download it, play with it and ping me if you have any comments or questions. The code is updated to work with ReSharper 5.1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=61155" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/Tools/default.aspx">Tools</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/ReSharper/default.aspx">ReSharper</category></item><item><title>Zen Coding and ReSharper PowerToys</title><link>http://devlicio.us/blogs/hadi_hariri/archive/2010/03/11/zen-coding-and-resharper-powertoys.aspx</link><pubDate>Thu, 11 Mar 2010 11:25:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:55858</guid><dc:creator>Hadi Hariri</dc:creator><slash:comments>22</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/hadi_hariri/rsscomments.aspx?PostID=55858</wfw:commentRss><comments>http://devlicio.us/blogs/hadi_hariri/archive/2010/03/11/zen-coding-and-resharper-powertoys.aspx#comments</comments><description>&lt;p&gt;Yesterday the &lt;a href="http://www.jetbrains.com/resharper"&gt;ReSharper&lt;/a&gt;&amp;nbsp;&lt;a href="http://twitter.com/resharper"&gt;Twitter Account&lt;/a&gt; tweeted about a Zen Coding Plug-in available as a PowerToy. If you&amp;rsquo;re not familiar with Zen Coding, &lt;a href="http://vimeo.com/7405114"&gt;check out this link&lt;/a&gt;. I received a couple of emails from people asking about the PowerToys and what exactly they were, and to be honest, I wasn&amp;rsquo;t really surprised. I don&amp;rsquo;t think many have actually heard of them. So I decided to follow &lt;a href="http://www.hanselman.com/"&gt;Hanselman&amp;rsquo;s&lt;/a&gt; advice of minimizing key strokes, thus the post.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;What are they?&lt;/h4&gt;
&lt;p&gt;The Power Toys are a series of plug-ins that have been written by the ReSharper developer team, and have been used in fact internally as samples of ReSharper&amp;rsquo;s API. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;Where can I get them and how do I install them?&lt;/h4&gt;
&lt;p&gt;You can download the PowerToys for ReSharper 5 from the Early Access Program page (for previous versions, see What next?), which is &lt;a href="http://www.jetbrains.net/confluence/display/ReSharper/ReSharper+5.0+Nightly+Builds"&gt;here&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_41FBCBC7.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_38AF6AB9.png" border="0" height="272" width="527" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Unless there&amp;rsquo;s some API change, there are normally compatible from one build to the next, but just to be safe, download the one corresponding to the nightly build you have. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_34756D27.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_36EE7918.png" border="0" height="340" width="479" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;They are packaged up in a zip file that contains MSI installers for each individual plug-in, as well as a PowerToys Pack which includes them all (and you can pick and choose which one you want during the installation process). Best option is to just pick the full pack. Each MSI is also suffixed with a version, 8 corresponding to Visual Studio 2005, 9 to 2008 and 10 to 2010. &lt;/p&gt;
&lt;p&gt;The zip file also contains another zip with the source code, which you can compile and install, if you don&amp;rsquo;t want to use an installer. If you&amp;rsquo;re doing this, compile them and place them under the %Program files%\&lt;a href="http://www.jetbrains.com"&gt;JetBrains&lt;/a&gt;\ReSharper\Bin\Plugins folder. Normally best to create a folder for each plug-in (If you&amp;rsquo;re just interested in having the source but prefer to use the MSI, the installer will also install the source for you).&lt;/p&gt;
&lt;p&gt;Once you install them, they should appear as plug-ins under the ReSharper menu:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_7D2B9393.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_19D4E2DC.png" border="0" height="350" width="426" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you can see from the list, there are quite a few goodies in there, not only Zen Coding! &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;What next? &lt;/h4&gt;
&lt;p&gt;The PowerToys are not only valuable in terms of the functionality they provide, but also serve as an example of how to write ReSharper plug-ins and interact with the ReSharper API, but they&amp;rsquo;ve never been released passed Early Access Programs. That is one reason 4.5 PowerToys are not available. &lt;/p&gt;
&lt;p&gt;However, we want to change that. We not only want to make them available, but also to document them and offer them as a true OSS project, where the developer community can contribute to them, be it with additional features, bug fixes or providing completely new plug-ins. &lt;/p&gt;
&lt;p&gt;This is something that I personally think would be valuable for the community. If you like this idea or have other suggestions, please feel free to give me feedback. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=55858" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/Tools/default.aspx">Tools</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/ReSharper/default.aspx">ReSharper</category></item><item><title>MSpec Live Templates</title><link>http://devlicio.us/blogs/hadi_hariri/archive/2010/03/01/mspec-live-templates.aspx</link><pubDate>Mon, 01 Mar 2010 15:07:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:55580</guid><dc:creator>Hadi Hariri</dc:creator><slash:comments>19</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/hadi_hariri/rsscomments.aspx?PostID=55580</wfw:commentRss><comments>http://devlicio.us/blogs/hadi_hariri/archive/2010/03/01/mspec-live-templates.aspx#comments</comments><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re using MSpec (&lt;a href="http://github.com/machine/machine.specifications"&gt;Machine.Specifications&lt;/a&gt;), you&amp;rsquo;ve no doubt run into the verbosity of it. Here&amp;rsquo;s a typical specification in MSpec&lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:3ce97efd-5c56-4b7e-b368-f1899582fb49" class="wlWriterEditableSmartContent"&gt;
&lt;div style="border:#000080 1px solid;color:#000;font-family:&amp;#39;Courier New&amp;#39;, Courier, Monospace;font-size:10pt;"&gt;
&lt;div style="background:#ddd;overflow:auto;"&gt; &lt;ol style="background:#000000;margin:0 0 0 2.5em;padding:0 0 0 5px;"&gt;
&lt;li&gt;&lt;span style="color:#ffffff;"&gt;[&lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;Subject&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#a5c25c;"&gt;&amp;quot;Registering as new a usergroup&amp;quot;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;)]&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;class&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;when_requesting_registration_page&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;Establish&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; context = () =&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;};&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;Because&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; of = () =&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;};&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;It&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; should_display_blank_registration_form = () =&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;};&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt; &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The code is usually divided into three areas, the &lt;i&gt;Establish &lt;/i&gt;that defines the context, &lt;i&gt;Because &lt;/i&gt;which is defined as the action to take, and finally one or more benefits that are defined as &lt;i&gt;It&lt;/i&gt; sections. Having this layout makes it easier to understand specifications and both the console runner as well as ReSharper&amp;rsquo;s MSpec runner remove underscores and provide a nice formatting. &lt;/p&gt;
&lt;h3&gt;Live Templates&lt;/h3&gt;
&lt;p&gt;However when it comes to typing all this in, well all those brackets and symbols become tiring. For that I normally use &lt;a href="http://www.jetbrains.com/resharper"&gt;ReSharper&lt;/a&gt; Live Templates. If you&amp;rsquo;re not familiar with these, think of them as code snippets that allow interaction. Each template is uniquely identified by a shortcut, which is a series of characters. To invoke it, you simply type the characters and hit TAB. It then inserts some code. Up to this point it&amp;rsquo;s like a normal snippet. The twist however is that you can then TAB through placeholders and define values (I&amp;rsquo;ll cover&amp;nbsp; Live Templates and all the possibilities it allows in a future post). &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_2B76B94F.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_1BF3A780.png" border="0" height="186" width="397" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;What I&amp;rsquo;ve been using for a while are some Live Templates for MSpec that allow me to define specifications with a little less effort. The first one is for empty specifications, which is useful for defining scenarios for features and then later proceeding to implement them, named &lt;i&gt;espec&lt;/i&gt;. The second one is for the specifications and implementation, named &lt;i&gt;spec&lt;/i&gt;. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_7C6457AA.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_5EA2CCEB.png" border="0" height="305" width="394" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;To install them, the easiest way is to just open up Live Templates (ReSharper menu) and Import the &lt;a href="http://hadihariri.com/Downloads/mspecbasiclivetemplate.xml"&gt;following file&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt; .   &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_76E5C139.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_272C95F0.png" border="0" height="186" width="335" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Obviously these are just two simple versions and can be expanded on. For instance, if you use Behaviors in MSpec, you could write an additional one for that. Feel free to use them for your own needs. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=55580" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/ReSharper/default.aspx">ReSharper</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/MSpec/default.aspx">MSpec</category></item><item><title>ASP.NET Support in ReSharper 5</title><link>http://devlicio.us/blogs/hadi_hariri/archive/2010/01/20/asp-net-support-in-resharper-5.aspx</link><pubDate>Wed, 20 Jan 2010 17:04:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:55082</guid><dc:creator>Hadi Hariri</dc:creator><slash:comments>18</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/hadi_hariri/rsscomments.aspx?PostID=55082</wfw:commentRss><comments>http://devlicio.us/blogs/hadi_hariri/archive/2010/01/20/asp-net-support-in-resharper-5.aspx#comments</comments><description>&lt;p&gt;Although I mentioned briefly in the past some of the new features ASP.NET MVC features &lt;a href="http://www.jetbrains.com/resharper"&gt;ReSharper&lt;/a&gt; 5 supports, I thought it would be a good idea to sum up the main ones in a single post and go into a little bit more detail on them. &lt;/p&gt;
&lt;h3&gt;&amp;nbsp;&lt;/h3&gt;
&lt;h3&gt;ASP.NET&lt;/h3&gt;
&lt;p&gt;ReSharper &amp;lsquo;s support for ASP.NET is not restricted only to MVC.In fact, most of the new features are for general ASP.NET, be it WebForms (also known as Traditional, Classic, For Historical Purposes Only?) or MVC. &lt;/p&gt;
&lt;h4&gt;&amp;nbsp;&lt;/h4&gt;
&lt;h4&gt;Go to File Member&lt;/h4&gt;
&lt;p&gt;As part of the code navigation features of ReSharper, you have the possibility to locate a file member, be it a method, property, class, etc. very easily by using the the &lt;i&gt;Go To File Member&lt;/i&gt; (Alt+\) option. You can search instantly and hit Enter to navigate to the specific one. [For the record, I&amp;rsquo;m using the Visual Studio Keyboard Scheme. If you&amp;rsquo;re using IntelliJ (why?) go to the web site and download the &lt;a href="http://www.jetbrains.com/resharper/documentation/documentation.html"&gt;PDF mapping files&lt;/a&gt;.]&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_5EB46561.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_497639EC.png" border="0" height="229" width="447" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Notice how it it looks for anything that matches the characters introduced, so for instance typing &amp;ldquo;Exc&amp;rdquo; would give us all those with the word &amp;ldquo;Exception&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_453C3C5A.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_75831110.png" border="0" height="193" width="452" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Well you now have this functionality in ASPX, ASCX, ASAX and Web.config files also as of ReSharper 5!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_4DFC1ED9.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_44BFE398.png" border="0" height="371" width="357" /&gt;&lt;/a&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The same goes for the File Structure tool Window (Ctrl+Alt+F). &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_5981B64B.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_7EFB0DDF.png" border="0" height="354" width="466" /&gt;&lt;/a&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;Go To Related Files&lt;/h4&gt;
&lt;p&gt;Many times, an ASPX has references to other files, such as Cascading Style Sheets, Javascript Files, Master Pages and User Controls. You can now navigate to these files efficiently by using the Go To Related Files (Ctrl+Alt+F7)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_5593A014.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_34DCB0A2.png" border="0" height="251" width="669" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;Master Pages&lt;/h4&gt;
&lt;p&gt;Version 5 also adds support for Master and Content Pages. To begin with, we have added support for navigation. Using &lt;i&gt;Go To Declaration (&lt;/i&gt;Ctrl+Left Mouse) on the &lt;i&gt;ContentPlaceHolderID&lt;/i&gt; will take you from the Content Form/Page to the corresponding ContentPlaceHolder of the Master Page&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_27F234B7.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_5760A383.png" border="0" height="81" width="660" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_49ADE77B.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_7341B2AE.png" border="0" height="155" width="662" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;If you are in the Master Page, you can navigate to all its inheritors (Shift+Alt+F12)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_7E1E93F6.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_22CFAB6E.png" border="0" height="269" width="459" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;You can also create content place holders from usage. When defining a &lt;i&gt;ContentPlaceHolderID &lt;/i&gt;that does not exist, you have the option to create it in the Master Page (Alt+Enter)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_4901DEF9.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_3C2788DB.png" border="0" height="148" width="668" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Last but not least, in a page that uses a master page, you can generate content place holders by pressing Alt+Ins&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_3CD03F05.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_5010F5A4.png" border="0" height="250" width="201" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;which in turn will bring up a dialog box for you to pick and choose what you want&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_543ACD69.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_514568B6.png" border="0" height="236" width="425" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;User Controls &lt;/h4&gt;
&lt;p&gt;You can now navigate to user controls as well as automatically import the correct references. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_26A987D9.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_4C33053A.png" border="0" height="187" width="504" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;File Generation&lt;/h4&gt;
&lt;p&gt;There are new code generation options for ASP.NET with version 5. By pressing Alt+Ins in the Solution Explorer, we are presented with a popup menu&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_28B660D5.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_789BE986.png" border="0" height="576" width="311" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;where you can choose from a selection of items to generate. You can also access this menu from anywhere (not only in the Solution Explorer) by now pressing Ctrl+Alt+Ins. This is actually an awesome new addition to ReSharper 5 (Ctrl+Alt+Ins) and it removes even more friction when create new items!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_154538CF.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_5A115D03.png" border="0" height="185" width="409" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;We&amp;rsquo;re asked for a name (which is the base minimum required to create an item) and If the item selected requires more information, then we&amp;rsquo;ll be prompted accordingly. For example, when creating a WebForm with Master Page, it&amp;rsquo;s convenient to specify which Master Page we want to use. In this case, once the page has been created, we&amp;rsquo;ll be given a chance to provide this information&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_220F6920.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_6094B6C6.png" border="0" height="113" width="505" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;I have to say, that I love Ctrl+Alt+Ins in ReSharper 5. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;Refactoring and Assistance&lt;/h4&gt;
&lt;p&gt;In terms of Refactoring and Coding Assistance there are a few new features. One of them is the auto-update of ending tags. If you have for instance a &lt;i&gt;div&lt;/i&gt; tag, and want to change it to &lt;i&gt;span&lt;/i&gt;, as you start typing &lt;i&gt;span&lt;/i&gt;, the end tag is automatically updated to reflect the changes you&amp;rsquo;re making live. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_04D99B49.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_3A8EE0A3.png" border="0" height="431" width="251" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;If you have a series of elements that you want to surround within a tag, you can easily do this by selecting all the elements and choosing Surround with Template (Ctrl+E,U)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_2ABF25D2.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_21EF1D86.png" border="0" height="225" width="365" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_6C95E553.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_7D9A1336.png" border="0" height="174" width="131" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_28FE3431.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_079E8E95.png" border="0" height="101" width="369" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;ASP.NET MVC &lt;/h3&gt;
&lt;p&gt;ReSharper 5 treats ASP.NET MVC as a first class citizen. As such, it now has knowledge of concepts such as Views, Controllers and Action. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;Navigate to View&lt;/h4&gt;
&lt;p&gt;For those of you working with ASP.NET MVC, you might have noticed that Views are now underlined in Actions&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_77AF49D0.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_043CF6ED.png" border="0" height="118" width="430" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;When you click on the View with Ctrl+Left Mouse, you&amp;rsquo;ll be presented with a dropdown menu&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_6D2E75B0.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_79BC22CC.png" border="0" height="87" width="437" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Here you have two options. The first is to navigate to the source for the &lt;i&gt;View &lt;/i&gt;method (navigation to external sources is another new feature of ReSharper 5). The second option is to go to the View. Although you can navigate to the View in Visual Studio by right-clicking and selecting &lt;i&gt;Go To View&lt;/i&gt;, one advantage the underlining adds is that it serves as hint for non-existent views, as you can see in the action below, which doesn&amp;rsquo;t have a corresponding View file. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_49B1D14B.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_5CF287EA.png" border="0" height="118" width="380" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;View discovery also works with named Views. If a named view exists, the string literal will be underlined&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_061A2029.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_64BA7A8C.png" border="0" height="111" width="380" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;On the other hand, if it doesn&amp;rsquo;t exist, it will be highlighted as an error, once again providing you the benefit of discovering any missing views earlier on. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_7B994C08.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_485D129F.png" border="0" height="129" width="373" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;h4&gt;&amp;nbsp;&lt;/h4&gt;
&lt;h4&gt;Action Links&lt;/h4&gt;
&lt;p&gt;Those of us who have worked with ASP.NET MVC applications, know the problems with using strings when defining ActionLinks. Not only do you run into issues when refactoring, but misspelling an action or controller causes unnecessary pain. Some of us, including myself, have often resorted to using the expression based Actions available in the MVC Futures library. &lt;/p&gt;
&lt;p&gt;ReSharper 5 now provides Intellisense, preventing you from mistyping Actions and Controllers&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_73C13399.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_04592E88.png" border="0" height="143" width="550" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Similar to named Views, if you define a non-existing Action, you will get it highlighted. The difference here is that by pressing Alt+Enter, ReSharper will create the Action for you (create based on usage)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_0163C9D5.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_37854224.png" border="0" height="131" width="550" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_55171D23.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_4CB347CC.png" border="0" height="138" width="549" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And much like Views, you can now navigate to Actions and Controllers from an ActionLink by choosing &lt;i&gt;Go To Declaration &lt;/i&gt;(Ctrl+Left Mouse) on the Action and Controller respectively. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_70F82C4E.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_02F44A0F.png" border="0" height="155" width="554" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;User Controls &lt;/h4&gt;
&lt;p&gt;Navigation is also provided for User Controls&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_78DFA8E3.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_49418A57.png" border="0" height="98" width="476" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;as well as Intellisense&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_019F8B63.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_6371CDAE.png" border="0" height="161" width="475" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;ve outlined some of the main features that ReSharper 5 brings to the table in regard to ASP.NET. There are many smaller features that you can discover eventually as you play with it more. If you haven&amp;rsquo;t yet, make sure you download 5 from &lt;a href="http://www.jetbrains.com"&gt;JetBrains&lt;/a&gt;. Don&amp;rsquo;t forget to follow &lt;a href="http://twitter.com/resharper"&gt;ReSharper on Twitter&lt;/a&gt; if you want tips, tricks and latest info.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=55082" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/Tools/default.aspx">Tools</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/ReSharper/default.aspx">ReSharper</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Writing plug-ins for ReSharper: Part 1 of Undefined</title><link>http://devlicio.us/blogs/hadi_hariri/archive/2010/01/12/writing-plug-ins-for-resharper-part-1-of-undefined.aspx</link><pubDate>Tue, 12 Jan 2010 13:27:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:54980</guid><dc:creator>Hadi Hariri</dc:creator><slash:comments>25</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/hadi_hariri/rsscomments.aspx?PostID=54980</wfw:commentRss><comments>http://devlicio.us/blogs/hadi_hariri/archive/2010/01/12/writing-plug-ins-for-resharper-part-1-of-undefined.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://www.jetbrains.com/resharper"&gt;ReSharper&lt;/a&gt; does a lot of things, but as they say, you can&amp;rsquo;t please &lt;a href="http://twitter.com/mfeathers/status/7406170728"&gt;all the&lt;/a&gt; people all of the time. However, one the great things about ReSharper is that it is quite extensible and there are already quite a number plug-ins available. Some of the better known ones are:&lt;/p&gt;
&lt;p&gt;- &lt;a href="http://stylecopforresharper.codeplex.com"&gt;StyleCop for ReSharper&lt;/a&gt; by &lt;a href="http://howard.vanrooijen.co.uk/blog"&gt;Howard Van Rooijen&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;- &lt;a href="http://code.google.com/p/resharper-tdd-productivity-plugin/"&gt;TDD Productivity Plugin&lt;/a&gt; by &lt;a href="http://www.lostechies.com/blogs/hex/"&gt;Eric Hexter&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;- &lt;a href="http://github.com/agross/machine.specifications/tree/master/Libraries/ReSharper/"&gt;ReSharper Test Runner&lt;/a&gt; for &lt;a href="http://github.com/machine/machine.specifications"&gt;MSpec&lt;/a&gt; by &lt;a href="http://therightstuff.de/"&gt;Alexander Gro&amp;szlig;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;and of course there is also the &lt;a href="http://www.jetbrains.com/resharper/plugins/"&gt;repository of plug-ins available from the JetBrains site&lt;/a&gt;, where many of these are located. &lt;/p&gt;
&lt;p&gt;Now I&amp;rsquo;m no expert on writing plug-ins for ReSharper, and the authors of the previous ones leave the bar quite high, but seeing that I actually now have the time to play with them, I&amp;rsquo;ve decided to do so by sharing my experiences with you in a series of blog posts. &lt;/p&gt;
&lt;p&gt;The ReSharper API is pretty extensive and can be overwhelming as I&amp;rsquo;ve been discovering, so I want to try and take it slowly. This might mean that at times, the code is not always complete and might be missing a few checks for example, but will come in due course. &lt;/p&gt;
&lt;p&gt;Everything that I&amp;rsquo;ll cover applies to &lt;a href="http://www.jetbrains.com/resharper/beta/beta.html"&gt;version 5.0 which is currently in Beta&lt;/a&gt;. There have been some changes from previous versions so if you&amp;rsquo;re working with 4.5 some of the code might not work. &lt;/p&gt;
&lt;h3&gt;&amp;nbsp;&lt;/h3&gt;
&lt;h3&gt;The First Plug-in&lt;/h3&gt;
&lt;p&gt;I was initially intending to write a useless plug-in for the first demo that didn&amp;rsquo;t do much, but after talking to &lt;a href="http://twitter.com/orangy/"&gt;Orangy&lt;/a&gt; (aslo known as Ilya) who commented on a tweet Jeremy Skinner had posted a few days back:&lt;/p&gt;
&lt;p&gt;&lt;a&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image_thumb51" alt="image_thumb51" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb51_5F00_7A64442B.png" border="0" height="238" width="473" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;we decided to use it as the first sample. &lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to build up the sample over the next few series of posts, so the initial solution is not the ideal one or complete, but it will help introduce a few core concepts. Ideally this feature should be implemented as what&amp;rsquo;s known as a &lt;i&gt;QuickFix&lt;/i&gt; but we&amp;rsquo;re first going to do it as a &lt;i&gt;ContextAction&lt;/i&gt;. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;ContextAction&lt;/h3&gt;
&lt;p&gt;So what exactly is a Context Action? It&amp;rsquo;s actions that can be applied based on the context (the name is quite descriptive). They shows up as items in a popup menu which is invoked using Alt+Enter (don&amp;rsquo;t use the mouse for this&amp;hellip;it&amp;rsquo;s very unproductive). &lt;/p&gt;
&lt;p&gt;&lt;a&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image_thumb4" alt="image_thumb4" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb4_5F00_7C711D27.png" border="0" height="97" width="244" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;What we want to do in this first version of the plug-in is to write a new action that makes methods that are public and not declared virtual, virtual, something NHibernate users would appreciate greatly. As mentioned previously, in this first version we&amp;rsquo;re going to add a context action. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;1. Creating a plug-in assembly&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;ReSharper plug-ins are assemblies that are located in Plugins folder (by default %programFiles%\JetBrains\ReSharper\v5.0\Bin\Plugins). Each plug-in is in it&amp;rsquo;s own folder and doesn&amp;rsquo;t require any further registration. Therefore the first step is to create a class library which will host our context action.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;2. Creating the Context Action Skeleton&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In order to create a context action, we need to implement the &lt;i&gt;IContextAction &lt;/i&gt;interface. This interface has one method &lt;i&gt;IsAvailable&lt;/i&gt; which indicates to us if that particular action is available given the context, and a property of type &lt;i&gt;IBulbItem[]&lt;/i&gt; which contains a series of bulb items. Each &lt;i&gt;IBulbItem&lt;/i&gt; in turn has a property &lt;i&gt;Text&lt;/i&gt; which is the text that appears next to the item in the context dropdown, and an &lt;i&gt;Execute &lt;/i&gt;action, which is what happens when the item is selected. So as we can see, a context action can consist of more than one bulb item. An added benefit to this decoupling is the re-usability of bulb items. By implementing &lt;i&gt;IBulbItem&lt;/i&gt;, we can potentially use it in more than once place (obviously if it makes sense).&lt;/p&gt;
&lt;p&gt;Many times however, we only want one bulb item per action, and to somehow simplify the process, we can inherit from the &lt;i&gt;BulbItemImpl &lt;/i&gt;class. This class defines an abstract &lt;i&gt;Text &lt;/i&gt;property that represents the text of the bulb item, and also has an &lt;i&gt;ExecuteTransaction&lt;/i&gt; member which is where our code is executed. We&amp;rsquo;ll see the difference between this method and &lt;i&gt;Execute&lt;/i&gt; shortly.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:6bd1437c-d08c-453d-8bfd-63640ee43d54" class="wlWriterSmartContent"&gt;
&lt;div style="border-bottom:#000080 1px solid;border-left:#000080 1px solid;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;color:#000;font-size:10pt;border-top:#000080 1px solid;border-right:#000080 1px solid;"&gt;
&lt;div style="background:#ddd;overflow:auto;"&gt;       &lt;ol style="padding-bottom:0px;margin:0px 0px 0px 2.5em;padding-left:5px;padding-right:0px;background:#000000;padding-top:0px;"&gt;
&lt;li&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;class&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#ffc66d;"&gt;MakeMethodVirtualContextActions&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;: &lt;/span&gt;&lt;span style="background:#000000;color:#ffc66d;"&gt;BulbItemImpl&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;, &lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;IContextAction&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;protected&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;override&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;Action&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;ITextControl&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;&amp;gt; ExecuteTransaction(&lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;ISolution&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; solution, &lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;IProgressIndicator&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; progress)&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;throw&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;new&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#ffc66d;"&gt;NotImplementedException&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;();&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;}&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;override&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;string&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; Text&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;get&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; { &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;throw&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;new&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#ffc66d;"&gt;NotImplementedException&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;(); }&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;}&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;bool&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; IsAvailable(&lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;IUserDataHolder&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; cache)&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;throw&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;new&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#ffc66d;"&gt;NotImplementedException&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;();&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;}&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;}&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;     &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Before implementing any of the methods, there&amp;rsquo;s one thing we need to do. ReSharper requires that context action have a constructor with a parameter that implements a &lt;i&gt;IContextActionDataProvider&lt;/i&gt;. This parameter is actually useful to use to provide information about the context as we&amp;rsquo;ll see shortly. Therefore, we need to add a constructor to the previous code (lines 6-9). Since our action is only for C#, we will use a &lt;i&gt;ICSharpContextActionDataProvider&lt;/i&gt;. We then save this provider for later use (line 3). What we&amp;rsquo;re effectively doing here of course is nothing more than dependency injection. The plumbing (passing in the correct provider) is taken care of for us by ReSharper.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:8ccd7ae7-ad88-4e81-a256-4357e662b61b" class="wlWriterSmartContent"&gt;
&lt;div style="border-bottom:#000080 1px solid;border-left:#000080 1px solid;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;color:#000;font-size:10pt;border-top:#000080 1px solid;border-right:#000080 1px solid;"&gt;
&lt;div style="background:#ddd;overflow:auto;"&gt;       &lt;ol style="padding-bottom:0px;margin:0px 0px 0px 2.5em;padding-left:5px;padding-right:0px;background:#000000;padding-top:0px;"&gt;
&lt;li&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;class&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#ffc66d;"&gt;MakeMethodVirtualContextAction&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; : &lt;/span&gt;&lt;span style="background:#000000;color:#ffc66d;"&gt;BulbItemImpl&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;, &lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;IContextAction&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;readonly&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;ICSharpContextActionDataProvider&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; _provider;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; MakeMethodVirtualContextAction(&lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;ICSharpContextActionDataProvider&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; provider)&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;_provider = provider;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;}&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;protected&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;override&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;Action&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;ITextControl&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;&amp;gt; ExecuteTransaction(&lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;ISolution&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; solution, &lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;IProgressIndicator&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; progress)&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;throw&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;new&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#ffc66d;"&gt;NotImplementedException&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;();&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;}&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;override&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;string&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; Text&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;get&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; { &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;throw&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;new&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#ffc66d;"&gt;NotImplementedException&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;(); }&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;}&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;bool&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; IsAvailable(&lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;IUserDataHolder&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; cache)&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;throw&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;new&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#ffc66d;"&gt;NotImplementedException&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;();&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;}&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;}&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;     &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;3. Defining Availability&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The next step is to define when our action is available. In order to do so, we need to implement the &lt;i&gt;IsAvailable&lt;/i&gt; method. In our case, we want to convert methods that are public and not virtual, to virtual. We therefore need to identify methods that are public and not virtual. We also need to filter out static methods. In order to get access to the current context we&amp;rsquo;re in, we can use the &lt;i&gt;provider&lt;/i&gt; we injected in via the constructor. The &lt;i&gt;provider &lt;/i&gt;has a &lt;i&gt;GetSelectedElement&lt;/i&gt; method which corresponds to the element the caret is on. Since we&amp;rsquo;re interested in a method, we can invoke this function, requesting back a method declaration. If the caret is in the context of a method (i.e. header, body), it will return this information. If it&amp;rsquo;s not, it will return null.&lt;/p&gt;
&lt;p&gt;If we have a valid method declaration, the next step is to find out if it is public. We do that by invoking &lt;i&gt;GetAccessRights &lt;/i&gt;[In later series we&amp;rsquo;ll see that further checks are necessary here]. If it is public, we then need to check whether it is a static method, an override or already virtual. Based on that, we return &lt;i&gt;true&lt;/i&gt; or &lt;i&gt;false&lt;/i&gt;, indicating whether the action is available in the current context. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:08892768-5c0f-43d7-bcea-9d5c989520f2" class="wlWriterSmartContent"&gt;
&lt;div style="border-bottom:#000080 1px solid;border-left:#000080 1px solid;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;color:#000;font-size:10pt;border-top:#000080 1px solid;border-right:#000080 1px solid;"&gt;
&lt;div style="background:#ddd;overflow:auto;"&gt;       &lt;ol style="padding-bottom:0px;margin:0px 0px 0px 2.5em;padding-left:5px;padding-right:0px;background:#000000;padding-top:0px;"&gt;
&lt;li&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;bool&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; IsAvailable(&lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;IUserDataHolder&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; cache)&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;var&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; item = _provider.GetSelectedElement&amp;lt;&lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;IMethodDeclaration&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;&amp;gt;(&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;false&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;, &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;true&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;);&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;if&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; (item != &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;null&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;)&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;var&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; accessRights = item.GetAccessRights();&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;if&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; (accessRights == &lt;/span&gt;&lt;span style="background:#000000;color:#bf82d7;"&gt;AccessRights&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;.PUBLIC &amp;amp;&amp;amp; !item.IsStatic &amp;amp;&amp;amp; !item.IsVirtual &amp;amp;&amp;amp; !item.IsOverride)&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;return&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;true&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;}&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;}&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;return&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;false&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;}&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;     &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;4. Performing the action&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;When the action is available and the user selects it, what we need to do is make the method virtual. This is done in the &lt;i&gt;ExecuteTransaction&lt;/i&gt; method. Since we are going to modify the code, we need to make sure that the file is writable. Normally this would be done by invoking a call to a method named &lt;i&gt;EnsureWritable. &lt;/i&gt;However, inside the method &lt;i&gt;ExecuteTransaction&lt;/i&gt;, this is done for us, so we don&amp;rsquo;t have to worry about it. This is one of the differences between &lt;i&gt;ExecuteTransaction &lt;/i&gt;and &lt;i&gt;IBulbItem.Execute&lt;/i&gt;. &lt;/p&gt;
&lt;p&gt;So how do we go about modifying code in ReSharper? Well remember that refactoring code is ReSharper&amp;rsquo;s daily bread. It&amp;rsquo;s what it does. As such, there&amp;rsquo;s a ton of infrastructure in place to allow us to do modify code easily. In fact, making a method virtual is as easy as calling a method, as shown below. &lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:1204f257-3604-47b1-8adc-681470f842d7" class="wlWriterSmartContent"&gt;
&lt;div style="border-bottom:#000080 1px solid;border-left:#000080 1px solid;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;color:#000;font-size:10pt;border-top:#000080 1px solid;border-right:#000080 1px solid;"&gt;
&lt;div style="background:#ddd;overflow:auto;"&gt;       &lt;ol style="padding-bottom:0px;margin:0px 0px 0px 2.5em;padding-left:5px;padding-right:0px;background:#000000;padding-top:0px;"&gt;
&lt;li&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;protected&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;override&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;Action&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;ITextControl&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;&amp;gt; ExecuteTransaction(&lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;ISolution&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; solution, &lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;IProgressIndicator&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; progress)&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;var&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; method = _provider.GetSelectedElement&amp;lt;&lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;IMethodDeclaration&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;&amp;gt;(&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;false&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;, &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;true&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;);&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;if&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; (method != &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;null&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;)&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;method.SetVirtual(&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;true&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;);&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;}&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;return&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;null&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;}&lt;/span&gt; &lt;/li&gt;
&lt;/ol&gt;     &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;5. Testing the plug-in&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The only thing left to do is test that it works (writing unit tests for plug-ins is something we&amp;rsquo;ll cover in the future). One option is to copy the assembly to the plug-in folder for ReSharper and restart Visual Studio. However, in order to be able to debug it, what we can do is set the project properties to start an external program, which is non other than &lt;i&gt;devenv.exe&lt;/i&gt;, and pass as parameter to it &lt;i&gt;/ReSharper.Plugin &amp;lt;Path_to_Plugin_Assembly&amp;gt;&lt;/i&gt;, instructing ReSharper to load a specific plug-in.&lt;/p&gt;
&lt;p&gt;How does ReSharper know which classes in the assembly are context actions? The easiest way is to decorate these with the &lt;i&gt;ContextAction &lt;/i&gt;attribute&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:816a2e31-64f6-4d00-80aa-ab30a90b5de4" class="wlWriterSmartContent"&gt;
&lt;div style="border-bottom:#000080 1px solid;border-left:#000080 1px solid;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;color:#000;font-size:10pt;border-top:#000080 1px solid;border-right:#000080 1px solid;"&gt;
&lt;div style="background:#ddd;overflow:auto;"&gt;       &lt;ol style="padding-bottom:0px;margin:0px 0px 0px 2em;padding-left:5px;padding-right:0px;background:#000000;padding-top:0px;"&gt;
&lt;li&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;[&lt;/span&gt;&lt;span style="background:#000000;color:#ffc66d;"&gt;ContextAction&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;(Group=&lt;/span&gt;&lt;span style="background:#000000;color:#a5c25c;"&gt;&amp;quot;C#&amp;quot;&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;, Name = &lt;/span&gt;&lt;span style="background:#000000;color:#a5c25c;"&gt;&amp;quot;MakeMethodVirtual&amp;quot;&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;, Description = &lt;/span&gt;&lt;span style="background:#000000;color:#a5c25c;"&gt;&amp;quot;Adds context action to make methods virtual&amp;quot;&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;)]&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#cc7832;"&gt;class&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="background:#000000;color:#ffc66d;"&gt;MakeMethodVirtualContextAction&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt; : &lt;/span&gt;&lt;span style="background:#000000;color:#ffc66d;"&gt;BulbItemImpl&lt;/span&gt;&lt;span style="background:#000000;color:#ffffff;"&gt;, &lt;/span&gt;&lt;span style="background:#000000;color:#6897bb;"&gt;IContextAction&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;{&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp; &lt;span style="background:#000000;color:#ffffff;"&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;     &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This information is also what appears under ReSharper &amp;ndash;&amp;gt; C# &amp;ndash;&amp;gt; Context Actions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image_thumb1" alt="image_thumb1" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb1_5F00_73A114DB.png" border="0" height="279" width="462" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Now all that&amp;rsquo;s left is to try it out. Write a new class, add a few methods and check to see it&amp;rsquo;s all working correctly.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image_thumb41" alt="image_thumb41" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb41_5F00_4C56A5D9.png" border="0" height="188" width="438" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Public static method (not available)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image_thumb5" alt="image_thumb5" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb5_5F00_5B3DD4F3.png" border="0" height="123" width="437" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Private method (not available)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image_thumb7" alt="image_thumb7" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb7_5F00_3EE06D06.png" border="0" height="206" width="434" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Public method (option available)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:709f2834-932c-4f9c-b242-351e666e3c37" class="wlWriterSmartContent"&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:709f2834-932c-4f9c-b242-351e666e3c37" class="wlWriterSmartContent"&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:905932bc-aad6-4994-8db7-63b30b97fccc" class="wlWriterSmartContent"&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:07444c36-2481-4557-b32b-f8c211b3e445" class="wlWriterSmartContent"&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:64c132f0-0ecb-48de-a052-a7760451521b" class="wlWriterSmartContent"&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:64c132f0-0ecb-48de-a052-a7760451521b" class="wlWriterSmartContent"&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;What&amp;rsquo;s next?&lt;/h3&gt;
&lt;p&gt;In this first part we&amp;rsquo;ve seen the basics of writing plug-ins for ReSharper. In the next blog post, we&amp;rsquo;ll extend the example to also include properties and we&amp;rsquo;ll change it to be a &lt;i&gt;QuickFix&lt;/i&gt; as opposed to a context action. This means that we&amp;rsquo;ll get some nice highlighting by ReSharper telling us something can be changed (similar to when you have something named incorrectly for instance), thus being more *in your face*.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s so much more to see than what&amp;rsquo;s here, and gradually we&amp;rsquo;ll drill more into each of the different areas, examining parameters, return values, etc. Until then, Happy ReSharping (did I just coin that? Too lame?)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=54980" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/Tools/default.aspx">Tools</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/ReSharper/default.aspx">ReSharper</category></item></channel></rss>