8

如何格式化以下行以消除 StyleCop 警告:

this.BeginInvoke(this.updateHandler,new object[]{this.tmpbuf});

现在,我收到 4 个警告:

  • Warning 4 SA1001: Invalid spacing around the comma.
  • Warning 5 SA1011: Invalid spacing around the closing square bracket.
  • Warning 6 SA1012: Invalid spacing around the opening curly bracket.
  • Warning 7 SA1013: Invalid spacing around the closing curly bracket.
4

1 回答 1

23
this.BeginInvoke(this.updateHandler, new object[] { this.tmpbuf });
  • SA1001 逗号后需要空格
  • SA1011 关闭方括号后需要空格
  • SA1012 打开大括号后需要空格
  • SA1013 关闭大括号前需要空格

有关相关规则的完整描述,请参阅StyleCop 间距规则。

于 2009-06-30T13:50:43.177 回答