自动调用方法后,部分已在MEF已经组成 [英] Automatically call method after part has been composed in MEF

查看:136
本文介绍了自动调用方法后,部分已在MEF已经组成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来指定一个方法被调用后自动一部分已经组成?该方法,也可以根据该合成的部分或在类做组合物。

Is there a way to specify that a method gets called automatically after a part has been composed? The method could be called on the composed part or in the class doing the composition.

推荐答案

是的。如果你的类实现了<一href="http://msdn.microsoft.com/en-us/library/system.componentmodel.composition.ipartimportssatisfiednotification.aspx">IPartImportsSatisfiedNotification接口,那么MEF容器将调用 OnImportsSatisfied 在合适的时间。

Yes. If your class implements the IPartImportsSatisfiedNotification interface, then the MEF container will call OnImportsSatisfied at the right time.

这篇关于自动调用方法后,部分已在MEF已经组成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆