QuickCode.NET - can't recommend it highly enough
Recently, I've been getting a bit bogged down with my .NET coding. I forever seem to be writing simliar chunks of code all the damn time and cursing VS .NET for not being able to expand little snippets of code into bigger chunks.
When I blogged Scott Hanslemen's awesome developer tools list, my friend Russell Pooley found QuickCode.NET. This code just just that. You tap a little bit of code into the editor, hit a key combination and it expands it for you, replacing placeholders in the script. For example:
I type: prop string MyString Gets or sets the string.
And when I hit Alt+Q, I get:
/// <summary>
/// Private field to support MyString property.
/// </summary>
private string _myString;
/// <summary>
/// Gets or sets the string.
/// </summary>
public string MyString
{
get
{
return _myString;
}
set
{
// check to see if the value has changed...
if(value != _myString)
{
// set the value...
_myString = value;
}
}
}
You can define your own patterns, obviously, and we're evaluating it in anger at one of my clients to get some consistency with our coding standards. A tool like this really makes that easy.
Now, I will say that it's not very sophisticated. In the example above, I would love it if it moved the fields to the top of the class. I'm not a big fan of regions, but that would be one way to do this. When I define my QuickCode .NET template, I could specify that chunk A was supposed to go in region Fields and chunk B was supposed to go in region Public Properties. That would make a big difference.
In fact, when I was writing my last entry on Windows Forms Thread Safety, this tool would be great for defining delegates and the code to flip between the UI.