c# - 是否有代码样式选项可以让 Visual Studio 不重新格式化 #pragma 指令?
问题描述
有没有办法告诉 Visual Studio 如何设置 pragma 的样式(例如 , #define
, #if
, #else
, #endif
,#region
等等)?
通常,pragma 位于一行中的第一个字符。如果我希望它们显示为内联并且不让 Visual Studio 为我重新设置它们的样式,我该怎么做?我在工具 | 中没有看到任何内容 选项 | C# | 代码风格。
namespace MySolution.MyProject
{
internal class MyClass
{
public void MyMethod1()
{
#if (USETHIS1)
// code here
#else
// code here
#endif
}
}
}
我在 Stack Overflow 和 Google 上进行了搜索,但没有看到任何内容,可能只是我搜索的方式。编译器接受任何位置的位置。
就标准而言,我更喜欢看到我的编译指示内联,就像上面一样。我怎么能那样做?
解决方案
推荐阅读
- apache - 运行 Flume 代理获取 Twitter 数据
- python - 处理 Altair 等值线图中的缺失值/空值
- powershell - 如何更改包含特定 ConnectionSpecificSuffix 的所有 NICS 的 DNS 服务器?
- c++ - boost::time_facet 不格式化时间
- java - Intellij 无法正确识别 Groovy 测试
- java - 方法在循环中的java中返回2个int值
- firebase - remoteconfig 是否再次获取所有密钥?
- linkedin - 为什么在将照片上传到 LinkedIn API 时收到 CLIENT_ERROR?
- pandas - 在夜间和白天之间选择数据
- node.js - 被 CORS 策略阻止:不存在“Access-Control-Allow-Origin”标头 [Nodejs]