Formatting StyleCop

How can I format the following line to eliminate StyleCop warnings:

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

Now I get 4 warnings:

  • 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.
+5
source share
1 answer
this.BeginInvoke(this.updateHandler, new object[] { this.tmpbuf });
  • SA1001 requires decimal place
  • SA1011 requires space after closing the square bracket
  • SA1012 requires space after opening braces
  • SA1013 requires space before closing braces

See the StyleCop space rules for a complete description of the relevant rules .

+20
source

All Articles