Modularize WinForms

0

I have the following scenario,

1 System

Containing several features of these features, there are some that are similar (Changes According to User Profile).

But I'm having trouble organizing this in the project.

I'm creating a base system, to call each different screen. Example:

System1 = > CadCli1

System2 => CadCli2

What I wanted to do, eliminate these "Systems".

Doing it as follows

System = > If profile 1 ChamaTela CadCli1           If not Profile2 ChamaTel CadCli2

But how would you do that? if the menu is already specified, the form to be instantiated?

CadCli1 cadCli= New CadCli1()
CadCli1.Show();

I have several screens so I do not think it would be viable to keep doing it in the opening code of each screen.

I'm probably organizing the system structure erroneously.

[upd] I found a way to instantiate the form through Reflection.

  Assembly assembly = Assembly.Load("clMod1");
  Type t = assembly.GetType("clMod1.frmCadCli");
  Form frmCadCli= (Form)Activator.CreateInstance(t);
  frmCadCli.ShowDialog();

Dai dynamically load the modules ("clMod1") through the Profile (configured in a table), would that be the solution?

    
asked by anonymous 10.08.2015 / 21:14

0 answers