I have a windows application (C# , .Net 4.0). This windows application is plugin based. I would like to pass an object from the main application to a plugin.
Somebody care to show me an example please? .
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
funny you should ask this, i’m working on something like this right now.
In the Interface that you are defining for the Plugins, provide a method/property that is the Interface from your application that the plugin can use.
Then inside your application implement that interface.
Now on your plugin call your Method passing in that Class that.
Now inside the plugin it will be able to utilise the methods and properties you have designed in the interface.
Now in your implementation of the plugin you can just go
And in your application you’d go
This is obviously not a complete example, but you should be able to get the idea.