mef

Factory pattern with Managed Ext Framework (MEF)

大兔子大兔子 提交于 2019-12-02 01:49:19
问题 I am trying to implement Factory Pattern with MEF. Here is my solution Core Project IClass ObjectFactory static Class(This is where the problem is) Project A [Export(typeof(IClass))] [ExportMetadata("Type", "TypeA")] public classA : IClass {} ProjectB [Export(typeof(IClass))] [ExportMetadata("Type", "TypeB")] public classB : IClass {} I am facing problem when I am trying to create object dynamically And here is factory class: public static class ObjectFactory { private static readonly

Which parts of MEF should be customized for dynamic loading of plug-ins in a distributed application

家住魔仙堡 提交于 2019-12-02 01:20:25
My simulation application will be using plug-ins to provide the simulation algorithms and data structures for the storage of the simulation data. The application consists of two parts. First is the host application which provides the UI (either as WPF UI or as plug-in to a CAD application). This application handles all interaction with the user but does not perform any of the simulation calculations, neither does it store any of the simulation data. The second part is the data application which performs the simulation calculations. The data application does not have any way for the user to

What's the difference between CompositionBatch and catalogs?

删除回忆录丶 提交于 2019-12-01 20:00:24
问题 I'm trying to wrap my brain around MEF, and one thing I'm struggling with is CompositionBatch. CompositionBatch appears to be a way to add or remove exports to the MEF system, but apparently it can't remove something that was added via a catalog, so it's limited in usefulness. It also, for some reason, operates at the container level, instead of at the catalog level with everything else that registers types in MEF. As far as I can tell, CompositionBatch is just a redundant way of doing what

What's the difference between CompositionBatch and catalogs?

余生长醉 提交于 2019-12-01 19:55:13
I'm trying to wrap my brain around MEF, and one thing I'm struggling with is CompositionBatch . CompositionBatch appears to be a way to add or remove exports to the MEF system, but apparently it can't remove something that was added via a catalog , so it's limited in usefulness. It also, for some reason, operates at the container level, instead of at the catalog level with everything else that registers types in MEF. As far as I can tell, CompositionBatch is just a redundant way of doing what you could already do with catalogs. If I want to register two new types after my application has

MEF - Get assembly from embedded DLL

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 19:32:11
I am using MEF to create "plugins" for my WPF application. Some of these plugins I want to embed directly into the EXE file as the EXE needs to be standalone. I am using Costura by Fody to embed the resource along with all my other references. As the exe file needs to be standalone I am unable to create a directory for these plugins and use the DirectoyCatalog Is there anyway I can either load the assembly from the embedded resource, or simply specify the assembly name such as: catalog.Catalogs.Add(new AssemblyCatalog("My.Assembly.Name)); I have tried looping through the Manifest resources but

Does MEF require .NET 4?

北城以北 提交于 2019-12-01 14:00:19
问题 I am using Visual Studio 2010, try to create a MEF application. Does this require .NET 4.0 or can I target .NET 2.0? 回答1: Yes you do: Application requirements change frequently and software is constantly evolving. As a result, such applications often become monolithic making it difficult to add new functionality. The Managed Extensibility Framework (MEF) is a new library in .NET Framework 4.0 that addresses this problem by simplifying the design of extensible applications and components. From

Mono and MEF Are they compatible.

隐身守侯 提交于 2019-12-01 13:57:59
问题 The two M's. Are they compatible? I would like to use MEF, or not, depending if it can run in MONO. 回答1: MEF is included in Mono 2.8 - see http://www.mono-project.com/Release_Notes_Mono_2.8 回答2: The latest version of Mono includes MEF, I believe, since it was open-sourced: Mono 2.8 I assume that means they're compatible. 来源: https://stackoverflow.com/questions/3909383/mono-and-mef-are-they-compatible

Robust Multi-Exposure Image Fusion:A Structural Patch Decomposition Approach

丶灬走出姿态 提交于 2019-12-01 10:21:16
  本文主要介绍了通过结构化块分解方法(SPD)来处理多曝光图像融合(MEF),最终起到对重影现象(ghosting effect)鲁棒的效果。    SPD-MEF 的主要思想是:将图像块解构为三个概念独立的部分,信号强度(signal strength)、信号结构(signal structure)、平均强度(mean intensity),分别进行融合处理后再还原到融合图像中。   Multi-exposure image fusion(MEF)提供了一种经济高效的方式来克服HDR成像与LDR显示之间的矛盾,将具有不同曝光度层次的源图像序列作为输入,生成一张比任何输入图像具有更多信息且感官上更具吸引力的图像。相比于HDR reconstruction在辐射域上实现的,MEF在强度域上工作。而在重影问题上,许多已有的算法都有高强度的计算负担,这对于移动设备来说是难以承担的,因此本文提出SPD-MEF这一简单而鲁棒的方式来解决在计算和重影上面对的问题。   SPD-MEF的一个特点是在 图像块 (image patches)上进行操作而不像在很多文献中的MEF方法常用到的 像素级 (pixel-wise)处理。   SPD-MEF首先将图像块解构为三个概念独立的部分,信号强度(signal strength)、信号结构(signal structure)、平均强度(mean

Overwriting dlls in MEF

时光怂恿深爱的人放手 提交于 2019-12-01 09:31:19
Right now, I'm trying to separate out a set of constantly changing classes into their own dll and dynamically load them using MEF. My problem is that whenever I try and overwrite the dll while the app is running, it says it's in use. Is there anyway to configure MEF to let me overwrite the dll and pick up the changes while the app is still running? This is not an MEF issue - it is your appdomain standard setup that locks the DLL's touched. Check http://www.vistax64.com/powershell/26164-reflection-assembly-loadfile-locks-file.html for a similar issue not involveind MEF. Basically, do not run on

How can I use CAS in .NET 4 to lock down my MEF extensions?

依然范特西╮ 提交于 2019-12-01 09:11:19
I have an application in .NET 4 that uses MEF for extensibility. My main application has three assemblies: Host , Application and Contracts . Host is the "boot-strapping" executable that creates the container and does the composition. Application contains the logic of my application, and more extension points for 3rd parties. Contracts contains the interfaces (and some helper classes) that are used in the extension points. Therefore, someone developing a 3rd party application has to include a reference to Contracts , but not to Application . I'm thinking that my security model should look like