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
开发者_JAVA技巧
without selecting each declaration.
I was facing the same issue and i tried many things but then i found one good solution and it works as well.. I have tried just now in my visual studio 2010. It is very easy to create getter and setter by just one step using this add on..
Please refer below link:- https://marketplace.visualstudio.com/items?itemName=AsEclipse.AsEclipseV210
精彩评论