1. What is MEF?
MEF is a new framework from Microsoft's collaborative construction of extended applications. It aims to add plug-ins to running applications. MEF inherits from the. Net 4.0 Framework Platform and exists in system programs of various application platforms.
2. Assembly
System. componentmodel. Composition. dll
3. Key Structure
Import
Export
Compose
4. Related Knowledge
Part: an object that can be imported or exported to applications
Catalog: an object that helps you find valid building parts in an assembly or folder.
Contract: The Import and Export parts must be communicated through the contract.
Import attribte: defines the needs of a part. It applies a single export attriute
Importmany attribute: similar to the import attribute, but supports multiple export attriutes
Export attribute: You need to create and export when creating the import. It serves as a participant in the build plug-in.
Compose: integrate exported with import
5. In a simple example, only a single export part is used in the current Assembly.
6. In a simple example, multiple export parts are used in the current Assembly.
7. In a simple example, multiple export parts are used in the integration directory and folder directory.
Description: Code 5, 6, and 7: mefdemo.rar