Split old .NET code into designer partial class

2019-01-21 07:56发布

I'm working on an older .NET code base that has all the designer code stuffed into the same code file as my code (pre - partial classes).

Is there a mechanism to tell Visual Studio 2008 to go back and refactor designer code into a X.designer.cs partial class file?

7条回答
我想做一个坏孩纸
2楼-- · 2019-01-21 08:39

If it's WinForms - I have a PowerShell script that edits the project and adds .designer.cs for all forms/controls.

You'd still have to move the designer code by hand though (or improve the script) - I only had a few forms and it wasn't worth the effort to add that too.

I can look it up and post it if that would help.

查看更多
登录 后发表回答