mef

MEF 2 Composition with .NET 4.5, Windows Store PCL

假装没事ソ 提交于 2019-12-24 13:50:37
问题 I am having trouble getting MEF to satisfy an import and could use some help. Unfortunately, the problem only manifests in a production code base. I tried to simplify the problem so I could post an example and see where my lack of understanding is, but the simplified version worked. So this is either I am missing the difference (and I have done my best to look thoroughly at the two), or the complexity is needed to reproduce. I have a WPF application consuming .NET 4.5 class libraries and

Silverlight PRISM Creating a custom module catalog

杀马特。学长 韩版系。学妹 提交于 2019-12-24 10:41:11
问题 I have created a silverlight application with PRISM and MEF. Is there a way to populate the modules catalog through some web service or database call? The example shown in the PRISM documentation gets the module information through XAP file which is included in the Shell project. In my case i need to get this list from some service. I read some articles which suggested to create a custom ModuleCatalog which implements IModuleCatalog. I am not able to find any example or code snippet on how to

Prism+MEF: delayed a service export from prism-module

半腔热情 提交于 2019-12-24 10:04:47
问题 I have an app based on Prism (v4 ctp) and MEF. The app has a service IService1. I want this service implementation was exported by some module (not just discovered by MEF) public interface IService1 {} public class Service1Impl: IService1 {} Service1Impl doesn't have ExportAttribute. This' because I want to create the implementation by hand in my Prism-module: [ModuleExport(typeof(SomeModule))] [PartCreationPolicy(CreationPolicy.Shared)] public SomeModule: IModule { [Export] public IService1

IronRuby error: Microsoft.Scripting.Actions.Calls.OverloadInfo (trying to port MEF)

谁说胖子不能爱 提交于 2019-12-24 07:04:37
问题 I'm trying to upgrade some 4 year old code from a blog post that allows IronRuby to import/export MEF parts. The code is at: https://github.com/JogoShugh/IronRubyMef Unfortunately, I get this error when attempting to run: Method not found: 'Microsoft.Scripting.Actions.Calls.OverloadInfo[] Microsoft.Scripting.Actions.Calls.ReflectionOverloadInfo.CreateArray (System.Reflection.MemberInfo[]) I only found one reference to this on the IronRuby forum, and sent another note. But, does anyone else

how to create an instance of a class of another module without adding reference using prism in wpf

℡╲_俬逩灬. 提交于 2019-12-24 06:04:41
问题 I am working on WPF application using Prism 4.0 and MEF. I want to create an instance of class A of Module A in Class B of Module B and want to access properties and methods of Class A without adding any reference of Module A in Module B. I know that prism provide this functionality, but don't know how to do it. We've specified all the assemblies in config file as follows: <modules> <module assemblyFile="ModuleA.dll" moduleType="ModuleA.ModuleA, ModuleA, Version=1.0.0.0, Culture=neutral,

How do I populate a MEF plugin with data that is not hard coded into the assembly?

陌路散爱 提交于 2019-12-24 04:41:10
问题 I am working on a program that will communicate with various pieces of hardware. Because of the varied nature of the items it communicates and controls, I need to have a different "driver" for each different piece of hardware. This made me think that MEF would be a great way to make those drivers as plugins that can be added even after the product has been released. I've looked at a lot of examples of how to use MEF, but the question that I haven't been able to find an answer to is how to

How to get all methods in MEF

房东的猫 提交于 2019-12-24 04:12:40
问题 I have attribute class [AttributeUsage(AttributeTargets.Method)] public class MethodGetterAttribute : ExportAttribute { } I'm using it in method of several namespaces: namespace Model.First { public class PersonBL { [MethodGetter] public void GetName(Person person) { } } } namespace Model.First.Second { public class PersonBL { [MethodGetter] public void GetName(Person person) { } } } namespace Model.First.Second.Third { public class WorkerBL { [MethodGetter] public void GetName(Worker worker)

How to get all methods in MEF

家住魔仙堡 提交于 2019-12-24 04:12:20
问题 I have attribute class [AttributeUsage(AttributeTargets.Method)] public class MethodGetterAttribute : ExportAttribute { } I'm using it in method of several namespaces: namespace Model.First { public class PersonBL { [MethodGetter] public void GetName(Person person) { } } } namespace Model.First.Second { public class PersonBL { [MethodGetter] public void GetName(Person person) { } } } namespace Model.First.Second.Third { public class WorkerBL { [MethodGetter] public void GetName(Worker worker)

Xamarin and Managed Extensibility Framework (MEF)

蓝咒 提交于 2019-12-24 03:32:00
问题 I'm thinking about a new mobile/tablet application. I want to allow the users to develop their own plugins. Imagine a cash desk application running on a Android tablet. The user could use many alternative when connecting to the credit card reader (Square, Sum'Up, ...). If my application was an old Win32, I would just publish an API and let Square or Sum'Up developpers create a DLL. This DLL would then be placed somewhere on the computer. At application startup, I just have to look for those

type or namespace name '…' could not be found (are you missing a using directive or an assembly reference?)

大城市里の小女人 提交于 2019-12-24 01:18:35
问题 This work's fine for another app that I'm transferring into this one. I've been stuck here for hours and google does not have much for MEF. the System.ComponentModel.Composition.dll is imported, yes. But still cannot get rid of this error. I have this for my includes: using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using System.ComponentModel.Composition; using JSNet; Affected code: var catalog = new AggregatingComposablePartCatalog(); var