开发者

Is it possible using Resharper to remove an object initializer?

开发者 https://www.devze.com 2022-12-09 16:27 出处:网络
Resharper 4.5 has the ability to turn the contstuction of an object followed b开发者_如何转开发y the setting of properties on that object into the object initializer format.

Resharper 4.5 has the ability to turn the contstuction of an object followed b开发者_如何转开发y the setting of properties on that object into the object initializer format.

My question is can it go the other way and remove the user of an object initializer?


I don't know about 4.5 specifically, but Resharper can currently (v7-8) do this - put your cursor on the opening brace of the object initializer, hit alt+enter, and select "to assignment statements"

This video shows you how.

0

精彩评论

暂无评论...
验证码 换一张
取 消