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..
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.
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?
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.