开发者

Encapsulate several field at once in Visual Studio 2010

开发者 https://www.devze.com 2023-01-17 06:55 出处:网络
In visual studio you can set accessors by using the encapsulate field refactoring operation on a declaration (Ctrl + E,R shortcut).

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

0

精彩评论

暂无评论...
验证码 换一张
取 消