StyleCop格式

7 c# stylecop

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

this.BeginInvoke(this.updateHandler,new object[]{this.tmpbuf});
Run Code Online (Sandbox Code Playgroud)

现在,我得到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.

Knu*_*gen 21

this.BeginInvoke(this.updateHandler, new object[] { this.tmpbuf });
Run Code Online (Sandbox Code Playgroud)
  • SA1001在逗号后需要空格
  • 关闭方括号后,SA1011需要空间
  • 打开花括号后,SA1012需要空间
  • SA1013在关闭花括号之前需要空间

有关相关规则的完整说明,请参阅StyleCop间距规则.