With the new smooth MEF programming model, if I have several directories:
- To which directory do I pass
RegistrationBuilder - Do I need to transfer a
RegistrationBuilder call to SatisfyImportsOnce ? - Which
SatisfyImportsOnce or ComposeParts use? (did something change with that in fluent mef?)
eg. Here is an example to illustrate my confusion (see Comments on rhs):
// Get pre-wired registration builder RegistrationBuilder rb = new MefCompositionRoot().CommonRegistrationBuilder(); // Register this WCF service class rb.ForType<LogService>().Export<LogService>(); var assembly = typeof (LogService).Assembly; var assemblyCatalog = new AssemblyCatalog(assembly, rb); // <-- HERE? var dirCatalog = new DirectoryCatalog("bin", rb); // <-- and HERE? // Combine catalogs var catalog = new AggregateCatalog(); catalog.Catalogs.Add(dirCatalog); catalog.Catalogs.Add(assemblyCatalog); var container = new CompositionContainer(catalog); container.SatisfyImportsOnce(this, rb);// THIS? container.ComposeParsts(this); ///or THIS?
source share