Simple Plugin with MEF .How Can I load plugin using a config File -
I am writing a small plugin architecture and I have decided to use the MEF I am told that we Should use a config file
Is there an example that uses a file and a config file?
I just have to set up a config file, is it possible? This is an example of a small node that I have created to test. I have load plugin function and config file is missing. Can you help
Node example
//mycompany.payment.Contracts. Dll Public Interface IPMant {Boole Pe (;); } // Mycompany.Pamment. Service Provider ONADL [Export (Typeface (iPad)]] Public Service Service Provider One: IPMENT {Public Bowl Pay (return true); } //MyCompany.Payment.ServiceProviderTwo.dll [Export (Type (IPMant))] Public class service provider two: ipmant {? Public bowl (return true); } // main console.Applications class program {Static Wide Men (string [] AGR) {HelperPlugin HelperPlugin = New HelperPlugin (); & Lt; IPayment & gt; MyLoadedPayments = helperPlugin.GetPlugins (); // blahhh conti}} public cos HelperPlugin {[diminished (typef (iPad)) public list & amp; Lt; IPad & gt; payment received; Set; } Public listing & lt; IPayment & gt; GetPlugins () {payment = new list & lt; IPayment & gt; (); LoadPlugins (); Return payment; } Private zero load plugins () {??? }}
How does the config file look like this?
Thanks for any suggestions or code snippets
I just like this one I am working on the problem and my view is this:
- I am planning to create a config file that defines my
constructor
will be configured < / Li> - In order to scan the container, there should be a list of directories in my config
- And my config should also support a list of assemblies that can be stored elsewhere, and many
Of the assembly
So basically, I am trying to configure the personal catalog which make up my
composite list
, to find composition container parts I will not use it yet, unfortunately - so it's in my head now - No code yet.
Comments
Post a Comment