Microsoft MVP Logo

This page serves as the portal for all information related to the productivity enhancements I've created for developers using Visual Studio 2005 / 2008 with DevExpress' CodeRush & Refactor! Pro.

Requirements

These tools have been tested with the latest releases of CodeRush & Refactor! Pro: v3.0.5 in both Visual Studio 2005 & 2008.

Download

This part of the page will be updated with the latest release of the components. How can you get news on when the latest are available? I'll post to my blog when there's a new update, so you can subscribe there to get updates as well as my other posts.

» Download the latest release - February, 2008 / v1.1.0

Here's a sample project you can use to play around with the tools without mucking up your project to get the feel for them.

Installation

Installation can be done in one of two ways (one day I'll get a WiX installer setup... but until then...):

Semi-automated

The provided install.bat file can do most of the work... but it can't import the templates.

  • Double-click the install.bat file included in the download. This will deploy the dynamic templates, plugins and refactorings.
  • If Visual Studio is open, you need to close and restart it to pickup the plugins and custom types.
  • Open Visual Studio and select DevExpress » Options.
  • In the Options dialog, navigate to the following section: Editor » Templates.
  • At the bottom of the dialog, set the Language to XML.
  • Right-click the Templates pane (white vertical box just to the right of the navigation tree) and select Import Templates. Select the XML file XML_SharePoint.xml to import the templates.
  • At the bottom of the dialog, set the Language to Plain Text.
  • Right-click the Templates pane (white vertical box just to the right of the navigation tree) and select Import Templates. Select the XML file PlainText_SharePoint.xml to import the templates. 

Manual

You will copy a handful of files to your profile, assemblies to the plugins directory and import the templates. The easiest way to get to the plugins and settings directories is to use the DevExpress About menu. Open Visual Studio and select DevExpress » About. Click the Settings... or Plugins... button to open the desired folder in Windows Explorer.

  • Copy the assemblies (3 DLL's) to the Plugins directory: C:\Program Files\Developer Express Inc\DXCore for Visual Studio .NET\2.0\Bin\Plugins
  • If Visual Studio is open, you need to close and restart it to pickup the plugins and custom types.
  • Open Visual Studio and select DevExpress » Options.
  • In the Options dialog, navigate to the following section: Editor » Templates.
  • At the bottom of the dialog, set the Language to XML.
  • Right-click the Templates pane (white vertical box just to the right of the navigation tree) and select Import Templates. Select the XML file XML_SharePoint.xml to import the templates.
  • At the bottom of the dialog, set the Language to Plain Text.
  • Right-click the Templates pane (white vertical box just to the right of the navigation tree) and select Import Templates. Select the XML file PlainText_SharePoint.xml to import the templates. 

Custom Types

CodeRush has a ton of features that allow you to create new fields or methods returning types using specific types. For example, typing fs[space] will create a new field based on the language you're in so if it was C#, it would create private string varName;. Thankfully you have the ability to create your own types that aren't already registered. For more info on custom types, check out Mark's post or this feature page on the DevExpress site.

The custom types included in the download contain four of the most popular SharePoint types: SPSite, SPWeb, SPList & SPListItem. Best part is that if the namespace Microsoft.SharePoint hasn't already been imported, it's automatically added. Check the screencasts to see a demonstration of this.

The four types included in the download are the following:

Template Description
spct Microsoft.SharePoint.SPContentType
spcs Microsoft.SharePoint.SPContext.Current.Site
spcw Microsoft.SharePoint.SPContext.Current.Web
spf Microsoft.SharePoint.SPField
sps Microsoft.SharePoint.SPSite
spw Microsoft.SharePoint.SPWeb
spl Microsoft.SharePoint.SPList
spli Microsoft.SharePoint.SPListItem

Note added for v1.1: You don't need to install these... in fact they were removed starting with the v1.1 download. DevExpress is now including these templates in the default CodeRush install starting with v3.0.

Refactorings

  • Create Web Part Definition (*.webpart)
    When the cursor is on a class that inherits from System.Web.UI.WebControls.WebParts.WebPart, this refactoring will automatically create a *.webpart file and add it to the project that already contains the Web Part class. In addition, the *.webpart file will be prefilled with the full type name (5-part name) and Web Part name.

XML Templates

The following tables document the various XML templates included in the download. For a demonstration, check the screencasts listed at the end of this page. Each of the screencasts demonstrating a template contains a table of contents with the name of the template for easily jumping to a specific demonstration in longer screencasts.

While the templates may seem complicated or hard to remember, notice they are written as mnemonics. For example, when you want to create a new <FieldRef> within a <ContentType> element, you are creating a element content type field reference... or ectfr.

General / Misc. Templates

Template Description
assemblyfullname Full name of an assembly, 4-part name.
ftd Field type definition.
newguid Generate a new GUID.
webpartxml Generate contents of a *.webpart file, automatically filling in the Web Part's type (5-part name) if it finds one within the current project.

Feature Definition Schema Templates

Template Description
fxml Feature definition file contents.
frxml Feature definition file for Feature receiver. If type inheriting Microsoft.SharePoint.SPFeature is found in the class, both the type and assembly full name are automatically filled.
fwxml Feature definition file for Feature containing custom workflow that utilizes InfoPath forms.

Feature Element Manifest (Site Element) Schema Templates

Template Description
exml Element XML file.
eca Element custom action.
ecag Element custom action group.
ect Element content type.
Note: If a content type ID is on the clipboard, such as copied from another content type, it is added in the ID attribute automatically.
ectb Element content type binding.
Note: If a content type ID is on the clipboard, such as copied from another content type, it is added in the ID attribute automatically.
ectfr Element content type field reference.
Note: If a GUID is on the clipboard, such as copied from a site column / field definition, it is added in the ID attribute automatically.
educ / edc Element delegate control (as a user control).
edsc Element delegate control (as a server control).
eer Element event receivers collection.
eerr Element event receiver.
efsta Element feature site template association (stapling Feature).
Note: If a GUID is on the clipboard, such as copied from a Feature definition, it is added in the ID attribute automatically.
ehca Element hide custom action.
New in v1.1.
eli Element list instance.
elt Element list template.
Updated in v1.1.
em Element module.
emf Element module file.
Updated in v1.1.
emfp Element module file property.
emwp Element module file for provisioning Web Parts into the Web Part Gallery.
esc Element site column (field).
Updated in v1.1.
ew Element workflow.
ewif Element workflow using InfoPath forms.
ewp Element workflow using ASP.NET 2.0 pages as forms.

Feature Element Manifest Schema Templates for Publishing Sites

Template Description
ectpp Element content type inheriting from Page content type.
emmp Element module provisioning master page file set.
emmpf Element module master page file.
Updated in v1.1.
empl Element module provisioning page layout file set.
emplf Element module page layout file.
Note: If a content type ID is on the clipboard, it is automatically added to the PublishingAssociatedContentType attribute.
empi Element module preview image.
emsl Element module for items in the Style Library.
eschtml Element site column using the Publishing HTML field type.

Solution Schema Templates

Template Description
sxml Solution node (within manifest.xml).
sa Solution assemblies node.
sasc Solution assembly safe control.
sacr Solution assembly class resources.
sfm Solution Feature manifest.
swp / sdwp Solution Web Part / DWP file provisioning to wpcatalog.
sr Solution resources.
srr Solution resources.
New in v1.1.
stf Solution template files.
stff Solution template file.
New in v1.1.
srf Solution root files.
srff Solution root file.
New in v1.1.

Bugs and Feature Requests

I've created a SharePoint list to submit bugs and Feature Requests. The list is setup to be anonymous so anyone can post stuff to it. Please use this list, and not the comments in this article, to submit bugs and feature requests:
http://andrewconnell.sharepointservers.com/BlogResources/Lists/CR_SharePointTools

Where To Get More Information?

Where can you get additional information? Below you'll find a handful of blog posts and screencasts. I think the screencasts are the best way to demonstrate exactly what these things can do.

Blog Posts

Change Log & Updates

  • AC's CR/R tools for SPDevs Updated: v1.1

Screencasts (demos)

Note: I'm aware the videos sometimes appear horizontally scrunched up... usually a few hard refreshes fixes it, but I'm still trying to figure out the root cause to resolve it. Regardless, they are still viewable and you should be able to see what is being presented just fine. If not, please let me know.

Note: all videos are for v1.0 and have not been updated for v1.1.

  • Overview (9 minutes) - updated August 22, 2007
    Get a quick overview of what is included.
  • Installation (4 minutes) - updated August 22, 2007
    Covers both the manual and semi-automated installation process.
  • Templates and Custom Types (9 minutes) - updated August 22, 2007
    Demos of some of a few templates not included in the Feature & solution schemas and the custom types.
  • Feature Schema (22 minutes) - updated August 22, 2007
    Detailed demos of all Feature schema templates. Notice the table-of-contents allowing you to quickly jump to a specific template.
  • Solution Schema (4 minutes) - updated August 22, 2007
    Detailed demos of all solution schema templates. Notice the table-of-contents allowing you to quickly jump to a specific template.
  • Templates specific to Publishing sites (12 minutes) - updated August 22, 2007
    Detailed demos of all templates useful for developers creating Publishing sites. Notice the table-of-contents allowing you to quickly jump to a specific template.
  • Refactorings (2 minutes) - updated August 22, 2007
    Detailed demos all refactorings.

DevExpress' CodeRush & Refactor! Pro

I wrote a post a while back giving my perspective on what these tools were all about. I think it's a pretty good and quick read:

The next best place to go is to check the product pages for these two products on the DevExpress Web site:

I'll admit, it's hard to really get a grasp of these tools by simply reading some pages on a Web site. DevExpress saw this and added a bunch of screencasts to their site. Even after using these products on a daily basis, I pick up stuff every single time I watch these!

Looking for a cheat sheet? Here's one done by Waldek.

Comments powered by Disqus