protected override IEnumerable <Export> GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) { List <Export> exports = new List <Export>(); ImportDefinition queryImport = TranslateImport(definition); if (queryImport == null) { return(exports); } // go through the catalogs and see if there's anything there of interest foreach (CompositionScopeDefinition childCatalog in _scopeDefinition.Children) { foreach (var partDefinitionAndExportDefinition in childCatalog.GetExportsFromPublicSurface(queryImport)) { // We found a match in the child catalog. Now we need to check that it doesn't get rejected. // if the rejetecion is enabled and atomic composition is present, we will actually have to do the work, if not - we just use what we have bool isChildPartRejected = false; if (_catalogExportProvider.EnsureRejection(atomicComposition)) { using (var container = CreateChildContainer(childCatalog)) { // We create a nested AtomicComposition() because the container will be Disposed and // the RevertActions need to operate before we Dispose the child container using (var localAtomicComposition = new AtomicComposition(atomicComposition)) { isChildPartRejected = container.CatalogExportProvider.DetermineRejection(partDefinitionAndExportDefinition.Item1, localAtomicComposition); } } } // If the child part has not been rejected, we will add it to the result set. if (!isChildPartRejected) { exports.Add(CreateScopeExport(childCatalog, partDefinitionAndExportDefinition.Item1, partDefinitionAndExportDefinition.Item2)); } } } return(exports); }