-
Add-Ons
This question might be one of those which can't be easily answered but I feel it's worth asking to see what replies I get.
I want to build my application and I want to be able to allow for "add-ons" to be installed, My project will be a MDI application with many different windows being opened in it.
I want some users to have optional other windows (winforms) which can be accessed. This means I need to someone work out what "add-ons" there are and adjust the menu and also add extra winforms?
I assume, extra DLL's can contain my windorms? if not how would I add these?
How can I get my menu to read what add-on's there are at the time my main window loads?
-
Re: Add-Ons
There are three ways to create a .NET application that supports add-ons or plug-ins:
1. Create a class library project and define an IPlugin interface in it. You will reference that library in your app and any plug-in developers will reference it in their libraries. At run time, your app searches one or more designated folders for assemblies and then, using Reflection, loads them and interrogates them to see if they contain any types that implement the IPlugin interface. Any that it finds it creates an instance of and then interacts with them through that IPlugin interface. If you search the web for .net plugin architecture then you should find some examples of this approach.
2. In .NET 3.5, Microsoft introduced the System.AddIn namespace, to provide a more standardised way to create extensible applications and add-ins for them. You would start by reading the MSDN documentation for that namespace and its children and then you could no doubt find examples online.
3. More recently, Microsoft has introduced the Managed Extensibility Framework (MEF), which provides greater functionality and flexibility. Again, start at MSDN.
Although it might take a bit more work to get up and running, I'd recommend option 3.