wpf - run all modules of a catalog (prism) -


I am using the prism desktop library.

What directory should I need and then, to run them.

I have to:

  directory module list list = new directory module (); Catalog.ModulePath = @ "C: \ Users \ Raph \ Documents \ Visual Studio 2010 \ Projects \ LibraryLoad \ LibraryLoad \ Modules";  

I checked, the modules are loaded in the catalog. Example of module:

  Public class SendEmailClass: IModule {Public Zero SendEmail () {MailMessage mail = New MailMessage (); similarity. From = new mail address ("**", "moi"); Mail.Subject = "Report"; // Manage managed topic mail. To Add ("***"); System.Net.Mail.SmtpClient smtp = New System.Net.Mail.SmtpClient ("smtp.gmail.com"); Smtp.Port = 57; Smtp.EnableSsl = true; // SMTP server network credential cred = new network credentials ("***", "***"); Smtp.Credentials = cred; Smtp.Send (mail); } Public Zero Starter () {SendEmail (); }}  

But then I want to run them (start my own initiation) but I did not find it. I want to run the entire list, is anyone having an idea? I tried the list. Start (), Catalog.Valit () or Catalog.load ()

Your code looks correct I was under the impression that you had to override the GetModuleCatalog () method in your Bootstrapper class to do this. Here is a work example of a very straight forward Bootstrapper that loads modules from a module directory.

  Public class Bootstrapper: UnityBootstrapper {Private const string MODULE_FOLDER = @ ". Module"; Protected Override IModuleCatalog GetModuleCatalog () {DirectoryModuleCatalog catalog = New DirectoryModuleCatalog () {ModulePath = MODULE_FOLDER}; Return list; }}  

Update

It is not possible to use bootstrap and load your module, but I do not know why you Do not take advantage of UnityBootstrapper class, it works for you

  Bootstrap bootstrap = new bootstrap (); BootStrapper.Run ();  

Your modules will be loaded. I have never done this without using bootstrapper because it is very straightforward.


Comments