1、导出所有的程序集并且实例化
private void Compose()
{
var catalog = new AssemblyCatalog(Assembly.GetExecutingAssembly());//反射
CompositionContainer container = new CompositionContainer(catalog);
container.ComposeParts(this);
}
2、导出指定文件夹里面的DLL,并且实例化
private void Compose()
{
var catalog = new DirectoryCatalog("Cards");
var container = new CompositionContainer(catalog);
container.ComposeParts(this);
}