Feature suggestion, templates to re-use existing regions

I use regions a lot, and I have altered the default class templates in
VS.NET to add regions for typical things, so my empty class actually
looks like this:

public class Class1
{
#region Private Member Variables
#endregion

#region Construction & Destruction
#endregion

#region Public Properties
#endregion

#region Public Methods
#endregion
// + protected and private method regions as well
}

Today I added a simple string property template, and it would be great
if I could highlight parts of the template to be added to specific
regions. If the regions requested by the template isn't already part of
the class, they could be added at the bottom automatically.

For instance:

#autoregion Private Member Variables

private String _$PropertyName$;

#endautoregion

#autoregion Public Properties

public String $PropertyName$
{
...
}

#endautoregion

this would mean another feature as well. Typically when I expand a
template with changeable parts, the first instance of each is
highlighted, it would be nice to be able to specify which instance
number to actually place, so that if I used the above template, the
private member variable would be placed in the correct place but I would
be typing in the property declaration since this is the one I'm
actually interested in.

--
Lasse Vågsæther Karlsen
http://www.vkarlsen.no/
mailto:lasse@vkarlsen.no
PGP KeyID: 0x0270466B

1 comment
Comment actions Permalink

Very nice idea !

VOTE

;)



Lasse Vågsæther Karlsen schrieb:

I use regions a lot, and I have altered the default class templates in
VS.NET to add regions for typical things, so my empty class actually
looks like this:

public class Class1
{
#region Private Member Variables
#endregion

#region Construction & Destruction
#endregion

#region Public Properties
#endregion

#region Public Methods
#endregion
// + protected and private method regions as well
}

Today I added a simple string property template, and it would be great
if I could highlight parts of the template to be added to specific
regions. If the regions requested by the template isn't already part of
the class, they could be added at the bottom automatically.

For instance:

#autoregion Private Member Variables

private String _$PropertyName$;

#endautoregion

#autoregion Public Properties

public String $PropertyName$
{
...
}

#endautoregion

this would mean another feature as well. Typically when I expand a
template with changeable parts, the first instance of each is
highlighted, it would be nice to be able to specify which instance
number to actually place, so that if I used the above template, the
private member variable would be placed in the correct place but I would
be typing in the property declaration since this is the one I'm
actually interested in.

0

Please sign in to leave a comment.