c# - Start controller from Program.cs instead of form -


i want build application in c#, using mvc pattern. want first create instance of controller , pass form parameter.

here normal c# way (default):

static void main() {     application.enablevisualstyles();     application.setcompatibletextrenderingdefault(false);     application.run(new mainform(new controller())); } 

the problem don't want mainform class able access controller. want controller "see" other objects.

i want this:

static void main() {     controller cnt = new controller(new mainform());     application.enablevisualstyles();     application.setcompatibletextrenderingdefault(false);     application.run(cnt); } 

this doesn't work though, because method run takes either form argument or applicationcontent. how can this?


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -