c# - MEF InheritedExport metadata -


i have experience simple usage of mef. want know how best following done.

  1. i have interface class
      [inheritedexport]     public interface ibaseview     {     }  
  1. i have multiple implementation classes following:
      [partcreattionpolicy(partcreationpolicy.nonshared), exportmetadata("displayname", "simpleview")     public class simpleview : ibaseview     {         //implementation     }  
  1. somewhere else, need enumerate displayname metadata exports present in container. (to show user). means not want create export, inspect type's metadata.

how do this?

have checked exportfactory comes mef 2? helps creating export instances dynamically. refer this msdn article exportfactory, , stack overflow answer on how use mef.

you can access metadata factory without creating export.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -