More on VS.NET macros
Jim Arnold and Jan Tielens have shown how to use a VS.NET macro to expand properties in C# and VB.NET, respectively. I'd like to add an alternative to VS.NET macros: QuickCode.NET. You can expand field definitions into properties simply by doing:
prop string test
Then hit ALT+Q, and it's expanded into the following:
///
/// Property Test (string)
///
public string Test
{
get
{
return this.test;
}
set
{
this.test = value;
}
}
Tweaking the expansion is easy to do in the editor. It's also extremely simple to accomodate C#, VB.NET, or any other language; you needn't create an entire macro for each respective language. There are plenty of useful default expansions (including one for try/catch/finally blocks), but I find that I add many of my own to accommodate my coding style.