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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -