在Visual Studio 2010中一次封装多个字段

问题描述 投票:2回答:1

在visual studio中,您可以通过在声明(Ctrl + E,R快捷键)上使用encapsulate field重构操作来设置访问器。

是否可以一次生成(使用默认设置)多个字段的访问者?

拥有:

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

没有选择每个声明。

visual-studio-2010 encapsulation
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.