Configuration Driven Module: LoadingIn this style of loading, modules are located by the ConfigurationModuleEnumerator, which scans the App.config file for modules and module dependencies.
protected override IModuleEnumerator GetModuleEnumerator()
{
ConfigurationStore store = new ConfigurationStore();
return new ConfigurationModuleEnumerator(store);
}
App.Config file entries
Directory Driven Module Loading: In this style of loading, modules are located by the DirectoryLookupModuleEnumerator, which scans the assemblies in a directory and locates all the types that implement IModule. It will also look for the ModuleDependency attribute to determine the dependent modules that need to be loaded before loading the current module. protected override IModuleEnumerator GetModuleEnumerator()
{ return new DirectoryLookupModuleEnumerator(@".\"); }
{ return new DirectoryLookupModuleEnumerator(@".\"); }
2 comments:
would it be possible to add a module after the application has been started. This would be great for debugging, trying out different implementations without restarting the app.
thanks, mbo
Hi mbo,
You can use the on deman loading of modules in composite WPF guidance for this situation.
Post a Comment