Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Using MEF with multiple user defined file extensions

Back to Forum: Tech Off
  • User profile image


    I am trying to implement syntax highlighting, intellisense etc. for a specialized language and I was hoping to use MEF. However since this heavily relies on providing a file extension at compile time and one requirement is that this extensions should apply to many different file extensions.. E.g. .atm, .bar, .foo .. 

    There seems to be no documentation whatsoever on the net. The only success I had was by reverese engineering IronPython tools.. 

    Thanks for any pointers..

  • User profile image
    Dr Herbie

    Not sure I understand you're question -- MEF loads DLL files (executable libraries).  MEF will load all DLLs in a given directory that have an interface marked as exported.

    If you're using MEF for syntax rules, I would expect you to have several DLLs in the same directory (one for each language supported), all exporting the same interface.  At runtime you use MEF to get a list of all the instances if found of that interface and then use the interface to interrogate each instance to see if it support the current language.

    From that point on you perform all syntax rules through that interface, using polymorphism to gloss over the fact that you don't know which specific instance you're using.


  • User profile image

    Hi Herbie,

    thanks for the answer. 

    I am referring to this :

    As fas as I understand, each content type can only be export for one, or more file extensions statically at compile time. 

    How do I export content types dynamically based on some user options for example? Is this not possible purely by MEF?


Conversation locked

This conversation has been locked by the site admins. No new comments can be made.