开发者

getting all instances of IFoo from MEF aggregatecatalog in silverlight

I am sure this cant be hard - can it?

the only func开发者_开发知识库tion seems to be GetExports but that seems to take 2 generic parameters plus a ExportDefintion that itself takes 5 values including a lambda - surely not? I thought I could do something like agcat.GetExports<IFoo>()


You don't get instances from a catalog you get them from a container.

var container = new CompositionContainer(agCat);
var foos = container.GetExports<IFoo>(); // Or GetExportedValues<IFoo>()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜