2010-09-20 41 views
2

在Visual Studio中,你可以通过使用一个声明(按Ctrl + E,R快捷键)的encapsulate field重构操作set访问。包封物的几个领域在Visual Studio一次2010

是否有可能产生(使用默认设置)几个领域的一次访问器?

具有:

private int one; 
private int two; 
//etc 

和生成:

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

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

//etc 

而不选择每个声明。

回答