Is it possible to mark an interface for export, so that all derived classes will be available for import?
[Export( typeof( IMyInterface ) )]
public interface IMyInterface { ... }
[Import( typeof( IMyInterface ) )]
private readonly ICollection<IMyInterface> m_Concretes = new Collection<IPlugin>();
I don't know which classes are implementing IMyInterface
in this example. The classes themselves do not know anything about MEF - and do not use the [Export]
attribute.
As long as I do not mark every single class with [Export]
it doesn't seem to work for me.