问题
Resharper is giving me this:
new MyObject {Prop1 = prop1, Prop2 = prop2}
But I want:
new MyObject { Prop1 = prop1, Prop2 = prop2 }
Currently it's breaking my StyleCop rules.
回答1:
I think this is the setting you are looking for.
http://screencast.com/t/nEXMHo6Ko Dead link
--Edit--
In case of a dead link, The setting is under C# -> Formatting Style -> Spaces -> Within single-line initializer braces. Check the box next to it and you'll be all set.
来源:https://stackoverflow.com/questions/6066437/resharper-force-space-after-curly-bracket-and-before-closing-bracket