views:

60

answers:

1

In visual studio you can set accessors by using the encapsulate field refactoring operation on a declaration (Ctrl + E,R shortcut).

Is it possible to generate (using the default settings) the accessors of several field at once ?

Having :

private int one;
private int two;
//etc

and generating :

public int One
{
    get { return one; }
    set { one = value; }
}

public int Two
{
    get { return two; }
    set { two = value; }
}

//etc

without selecting each declaration.

A: 

Take a look of CodeHelper 1.5

-Encapsulate one or multiples fields
-Entity Class generator from tables
-Store procedure and SQL Statetments generator from tables
-Methods for insert/update/delete records
-Backup for Solution and projects
-and many others, take a look (bluemusa.com)

or here on MSDN
http://visualstudiogallery.msdn.microsoft.com/en-us/c736dedf-bbed-454a-8073-89993ca46902

rafaelsr