Reputation: 10820
The old code, as we know, is dangerous because both GUI layout and business logic are mixed into one. Separating the two can be a tedious and an error-prone task. Is there a tool that can do this for me?
Thanks.
EDIT: The pretty obvious way of keeping the UI and the logic separate is through introduction of a partial class. I hope that clarifies the question. I suppose I am simply trying to go from 1.1 to 2.0 way of doing things. Simply opening and saving the old design in VS2008 does not do what I want.
Upvotes: 3
Views: 378
Reputation: 941357
No tool, but easily accomplished with cut-and-paste text editing. Add a new form to your project. In the Solution Explorer, open the node next to the form and double-click the Designer.cs file. Cut and paste the InitializeComponent() method from your old form to that file. Cut and paste the rest of your code. Remove the old form, change the class name of the new one.
Upvotes: 3
Reputation: 44288
There is no "standard", but lots of standard like ways people separate logic from UI. It forces you to design a particular way. So its a bit impossible to automatically redesign your software.
The best you have is refactoring tools, check out something like Resharper, makes it a bit safer to make some transformations.
Upvotes: 2
Reputation: 10221
No. Sry to say but there is no such tool, that is still manual work. If you're looking into doing it anyway I would suggest looking into WPF development, since the separation is much easier to realize there.
Upvotes: 1