Chad Osgood's Blog

Chad Osgood's Old, Expired Blog

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.

Comments

Oddur Magnusson said:

Check out QuickCode, it does the same, but also a lot more. And is a while lot smoother.

typing in:
propv string name

and pressing alt-q is all there is to it !

http://quickcode.dvxp.com/
# April 29, 2003 8:38 AM

Oddur Magnusson said:

Whoops, that was supposed to be a comment on another post(http://dotnetweblogs.com/JArnold/posts/6175.aspx) clumsy me!
# April 29, 2003 8:40 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)