This project has moved. For the latest updates, please go here.

SetImport Implementation

Nov 22, 2009 at 10:59 AM

Hi Guys.

I have problems to implement the SetImport-Method on my own CustomComposablePart class.

The problem is that the SetImport-Method must be recursively, so that subsequent mef-component are also Setted.

The Question is how can i implement the Method that all subsequent mef-component are also setted?

I looked at the ReflectionComposablePart. The MEF team using through ImportingItem Class .. the methods of the ImportEngine
StatisfyImports(..) ,... TryStatisfyImnports, ... and so on to set subsequent mef-component.

By default i have no access from composablepart to those methods?
How can i set subsequent mef-components? Which alternatives do i have?


Nov 22, 2009 at 7:28 PM

The recursion that happens in the ReflectionComposablePart is all triggered by calling GetExportedValue on the Export that is passed to SetImport. The ReflectionComposablePart nor the ImportingItem have access to the ImportEngine itself that is an implementation detail fo the Export that they are working with, in most cases the Export which comes from the CatalogExportProvider which does have information about the ImportEngine.