Recomposition actors

Mar 3, 2010 at 3:42 PM

Hi,
when I call directoryCatalog.Refresh() and I have a recomposable import

[Import(AllowRecomposition = true)]
IEnumerable<IPlugin> Plugins...

who updates the Plugins property with a new instance?

Thanks
Federico

Developer
Mar 4, 2010 at 3:34 AM
Edited Mar 4, 2010 at 3:35 AM

I assume you want a more detailed answer then the CompositionContainer ;)

Lets see if I can give you a general flow of how recomposition occurs. When you call Refresh on the DirectoryCatalog it will fire an event which the CatalogExportProvider is listening to and in turn will fire its ExportsChanging/ed events which get propagated out to to the CompositionContainer (perhaps traveling through the AggregateExportProvider). The ExportsChanging event on the CompositionContainer is being listened for by the ImportEngine and when it receives this event it checks to see if the changed exports affect any of the imports that it knows about and if so it will reset the values of the affected imports.

So to directly answer your question the ImportEngine updates the Plugins property. 

I hope this makes some sense and gives you a better idea of how recomposition happens.

Mar 4, 2010 at 8:02 AM

Thanks weshaggard! You saved me a lot of time. 
Likely in the coming weeks I'll ask other questions :D

Have a nice day!!
Federico