开发者

PRISM / MEF : ModuleExportAttribute vs ExportAttribute?

I don't understand w开发者_运维问答hat the difference here is, anyone care to explain how a ModuleExport is different than an Export?


ModuleExport is an ExportAttribute, but with some additional module-specific properties.

If you look at the source code for ModuleExport you find that it has all of the properties of an ExportAttribute, plus:

  1. ModuleName
  2. ModuleType
  3. Module Dependencies
  4. Module Initialization

All of these come from the interface IModuleExport.

If you look at the ImportedModules property of MefModuleManager (the class responsible for finding modules), you see that is imports them all using the IModuleExport interface, so this why you are required to use an attribute implementing IModuleExport, rather than just straight up [ExportAttribute(typeof(IModule))].

Hope this is what you were looking for.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜