mef

Integrate language service (MPF) and editor extension (MEF)

Hi, Does anybody the correct way to integrate a languageService (MPF) with an editor extension (MEF) in Visual Studio 2010. Where to implement the member completion, syntax highlight, quick info, etc.? Any example avaliable? Thanks! ...

Where did the ExportFactory<T> from desktop MEF go?

I can't find it!? ...

How do I get MEF to recompose when I change a part?

I am trying to get MEF to recompose all the parts that it knows about when I update an instance that is exported. Essentially I want to have MEF update all my parts that import a connection string configuration value when it is changed. Everything looks good up to the point where I want to change the instance. If I try to ComposeParts wi...

Removing parts from CompositionContainer using a CompositionBatch object

I have a MEF based solution that has several exported implementations of an interface. What I want to be able to do is have a switch that removes ALL the current parts associated with the interface, and in their place, replace them with just a single implementation. I've been trying to do this with a CompositionBatch object, but it does...

How to export & import functions and execute them with MEF?

I am creating an application that imports several plugins. I need the ability to execute functions that are implemented in each of the plugins. For example, I need to do something like this. ///////////////////////////////////////////////////////////////////////////////// MainApp: [ImportMany(?)] public IEnumerable<Lazy<?>> PluginFu...

question about Shared Policy in MEF with Silverlight

this is the table from the official MEF document Part.Any Part.Shared Part.NonShared Import.Any Shared Shared Non Shared Import.Shared Shared Shared No Match Import.NonShared Non Shared No Match Non Shared My question is that for the "No Match" case(Export is shared...

How to replace an exported part / object in a MEF container ?

I have a WPF app running, which needs all operations that affect the UI to be on the UI Thread. WPF also provides a Dispatcher class that handles this - so I extracted that into a dependency. public interface UIActionExecutor { void Do(Action action); } So in my production code, I use an exported implementation which d...

Should the Managed Extensibility Framework be used to consume external plugins?

I think i get the MEF model. But I'm having a hard time seeing if it fit's with what I'm trying to do. I have an app which will call out to third party plugins to do some video processing. The plugin can be FFMPEG.exe or x264.exe, doesn't matter. The process of calling the plugins is via the ProcessStartInfo (basically through the co...

How to get the assembly information of an imported MEF function?

Is it possible get the assembly information from an imported MEF function? I need to know the assembly version and name of the Plugin control that contains the function. Tried the following, but it just returns the System.ComponentModel.Composition version. foreach (Lazy<Func<int>, IMetadata> func in PluginFuncs) { // get assembl...

Is it possible to change how MEF creates imported objects?

I would like to use MEF to find my extensions but keep the responsibility for creating them to Ninject or a custom factory. Is that possible? ...

MEF get implementors for a type known only at runtime

Hi, I'm using MEF and XML serialisation in my application. To put my question simply can i write a static class with a function like this: public static List<Type> GetImplementations(Type type, AggregateCatalog catalog) { ??? (type is an abstract class) } The back story: I use MEF to enable third party pluggins, however i want t...

Using MEF with multiple Projects in a Solution

Hi, I have a solution with the following structure: Solution Main Exe Utilities When I use MEF within the Utilities project I find that neither of the following MEF catalogues pick up types held within the Main Exe catalog.Catalogs.Add(new AssemblyCatalog(Assembly.GetExecutingAssembly())); catalog.Catalog...

MEF Import attribute

Using MEF, I know you can do this to import your interface: class MyClass { [Import(typeof(IUser))] private IUser m_userName; } Can I do something similar but within the method? For example, this below does not compile: class MyClass { public void DoWork() { [Import(typeof(IUser))] IUser userName; userNam...

Wordpress-like Plug-in model in ASP.NET MVC

This is kind of based off of this question. I'm currently looking at rebuilding our company intranet from the ground up (I'll be honest, our existing one is an absolute mess), but one of the core "features" of our new intranet that I'd like is the ability to build whole applications (which will also probably be in MVC 9 times out of 10,...

WPF & MEF UserControl part of a larger view (In design mode)

I want this usercontrol to be Created via MEF but also to have the usercontrol positioned and properties set on it in Blend... How can I force the composition of the imports that the usercontrol requires when I have a 'Concrete' reference to the usercontrol ? What happended to PartsInitializer.Satisfy ? Export for the UserControl ...

Asp.net MVC 3 inject UserControl for TemplateHint

Is it possible to somehow leverage the dependency injection in Asp.net MVC 3 (using the Forms ViewEngine) to inject UserControls from another library? I am already using MEF to load some other stuff into my MvcApplication. I need this because I want to build a system with an expandable type system. I want the type vendor to be able to ...

MEF Silently Stops Finding Exports in Deployment Catalog?

When my Deployment Catalog contains System.Windows.Controls.Layout.Toolkit.dll MEF 'breaks'... All I'm doing is adding a reference to this file in my project and the following diagnostics code writes nothing to the VS Output Window: this.CompositionContainer.ExportsChanged += (s, args) => { var o = args.AddedExports; o.ToList()....

MEF. How to load a winform into winfrom container ?

Hi guys, I have dicided to play a little bit with MEF2 and net3.5 and I have thougth it would be easy but I am stuck now. Generaly the idia of my toy is I want to have form containet where I am going to load form extantions and show them. I did this code My extantion : using System.ComponentModel.Composition; using System.Windows.For...

How to use MEF's GetExport\ImportDefinition?

MEF n00b here. I've got main project, and a series of dll's that have specific implementations of some interfaces as well as view\viewmodels, etc. I use {ImportMany] to get them all with some metadata, which allows me to choose one, which gives me a reference to the specific implementation of ISystem. I'd like to get the only specific ...

Mono and MEF Are they compatible.

The two M's. Are they compatible. I would like to use MEF, or not, depending if it can run in MONO. Thanks. Bob. ...