Can i write a class to use mef to import all types implementing a specific interface and then specify this interface at run time. (i know i need to tag the implementors with export)
Example usage:
IEnumerable<IExcitingClass> excitingClasses = ClassImporter<IExcitingInterface>.ImportAllFrom(specifyDirectory);
Is this possible?
You can create a container using a DirectoryCatalog, and call container.GetExportedValues<IExcitingClass>. Is that what you want?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With