可以通过编程方式禁用Visual Studio代码自动格式化吗?以编程方式禁用Visual Studio代码格式
我希望我保留相关属性在一起像
public class Test
{
public string Prop1 { get; set; }
public bool Prop2 { get; set; }
internal string Prop2String { get { return Prop2 ? "Yes" : "No"; } }
}
但Visual Studio的格式,它一类
public class Test
{
public string Prop1 { get; set; }
public bool Prop2 { get; set; }
internal string Prop2String
{
get { return Prop2 ? "Yes" : "No"; }
}
}
我不想关上的Visual Studio完全格式化,但只在代码的特定位置。
您可以通过在键入时不打回车来获得第一个“选项”...? (注意:它仍然格式化该行上的间距*,因为你关闭了大括号) – crashmstr 2014-09-12 14:19:53
我很嫉妒。我的视觉工作室没有像第二个那样格式化。你为什么不要那样想呢。 – DidIReallyWriteThat 2014-09-12 14:24:11
我有一个类的负载属性和一些这些内部属性只翻译使用扩展方法的其他属性。像布尔到'是'/'否'字符串存储在一个设计不佳的数据库。 – 2014-09-12 14:27:23