标签:style blog class code color get art rgb http line type
CompositionContainer 公开了一部分获取导出、导出对象以及两者集合的重载。
var container = new CompositionContainer(new AssemblyCatalog(typeof(Program).Assembly)); Root partInstance = container.GetExportedValue<Root>();
[Export("my_contract_name")] public class Root { } var container = new CompositionContainer(new AssemblyCatalog(typeof(Program).Assembly)); Root partInstance = container.GetExportedValue<Root>("my_contract_name");
Lazy<Root> export = container.GetExport<Root>(); var root = export.Value; //create the instance.
var root = container.GetExportedValueOrDefault<Root>(); // may return null
MEF 编程指南(十一):查询 CompositionContainer,布布扣,bubuko.com
MEF 编程指南(十一):查询 CompositionContainer
标签:style blog class code color get art rgb http line type
原文地址:http://www.cnblogs.com/JavCof/p/3700788.html