B
Bill Burris
When you crate a Windows application the wizard adds a line like:
Application.Run( new MyMainForm() );
Out of curiosity I replaced this with:
MyMainForm myForm = new MyMainForm();
myForm.ShowDialog();
and run the application with no problem.
Is there any reason why I should use Application.Run instead of
myForm.ShowDialog?
The reason I ask, is I want to place lots of smarts before launching the
GUI. Using agile programming techniques (unit testing, refactoring) I want
to create a functional application before adding the GUI layer. The reason
for doing it this way is that I end up with testable, reusable code, and no
business login in the GUI. Since the GUI is an add-on, the same application
code can be deployed, in a windows app, a service, a web service, a web
form, or console app.
By the way, I added a parameter to the MyMainForm constructor to so that the
GUI code can call back into the objects which get created before the form is
created.
Bill
Application.Run( new MyMainForm() );
Out of curiosity I replaced this with:
MyMainForm myForm = new MyMainForm();
myForm.ShowDialog();
and run the application with no problem.
Is there any reason why I should use Application.Run instead of
myForm.ShowDialog?
The reason I ask, is I want to place lots of smarts before launching the
GUI. Using agile programming techniques (unit testing, refactoring) I want
to create a functional application before adding the GUI layer. The reason
for doing it this way is that I end up with testable, reusable code, and no
business login in the GUI. Since the GUI is an add-on, the same application
code can be deployed, in a windows app, a service, a web service, a web
form, or console app.
By the way, I added a parameter to the MyMainForm constructor to so that the
GUI code can call back into the objects which get created before the form is
created.
Bill