Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LOADING ASSETS FROM REFERENCED PROJECTS DYNAMICALLY
- If you have other projects loaded in your project.
- For example, you have a winforms application and you reference other winform projects which deal
- with specific sections of your site.
- These sections are accessible through a single menu, in our example a listview.
- We can load a particular form from one of these projects depending on
- the user's selection during run-time.
- The listview has two columns, represented by "|", the second is hidden.
- FIGURE 1 - Form ADMINISTRATION
- |----------------------------------------------------------|
- | ADMINSTATION |
- |----------------------------------------------------------|
- | |
- | |Listview |
- | ---------------------------------- |
- | |Add Users | UserForms| |
- | |Delete Users | UserForms| |
- | |Manage Users | UserForms| |
- | |Add Invoice | FinanceForms| |
- | |Manage Payrolls | FinanceForms| |
- | |Order Stock | UserForms| |
- | |Delete Stock | UserForms| |
- | |Manage Users | UserForms| |
- | |
- ------------------------------------------------------------
- You can handle the click event with the following function.
- Private Sub lvwUtilisateurs_Selection(ByVal eventSender As System.Object, ByVal e As EventArgs)
- String form =
- string dllName = "UserForms";
- var loadedClassFromDll = Assembly.Load(dllName).CreateInstance(strObjTmp);
- loadedClassFromDll.Show();
- Dim nspc As String = strObjTmp.Substring(0, strObjTmp.LastIndexOf("."c))
- Dim o As Object = Nothing
- clsObjet = Assembly.Load(nspc).CreateInstance(strObjTmp)
- clsObjet.frmFenMDI = FMdiBal
- strTable = lvwMenu.clsSubItems("FctCod").Text
- Select Case strTypeFonction
- Case "Consultation"
- clsObjet.Consulter(strTable)
- Case "Proposition"
- clsObjet.Saisir(strTable)
- Case "Hors Proposition"
- clsObjet.Saisir(strTable, strAcces)
- Case "Tables de référence"
- clsObjet.Table(strTable, strAcces)
- Case "Impression"
- clsObjet.Imprimer(strTable)
- End Select
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement