design - Plugin based application in C# -


I would like to create a graphical user interface application using the language of my choice, the application will run on Windows XP. It will be some kind of a complex Windows Form application. I think and according to most suggestions, best to use C #, the tree structure on the left side of the GUI will be populated after reading from a configuration file which will be a binary file. (But initially I can work with a simple ASCII file to test my code.) The application will accept some input from the user through this GUI and will be written back in the same config file and the tree on the form The structure or labels or any related fields will reflect the change.

There will be 3 tabs and 3 related config files for each tab. I need some help in designing the application for now. Am I planning to use the host app (main application) and use the 3 tab control as plugins, is it practical? If you can do so please guide me on this. I mean how do I do 3 plugins in C # and how do I write the interface so that the main application knows which plug-in is loading and when it is loaded? What would be a separate "plugin" folder under my project folder? I hope you've got my point, even though this information is very short for you.

Something besides this. CPP files are already present in this project. With some files, these files contain some important definitions and constants in them. It needs to be integrated with my C # application. I have no clue how to do this, but I'm sure that .pppp code Dll is compiled by compiling and then compiled. It is possible to highlight Dll on my C # application. Please tell me if you need some more information for top level design.

Thanks, Varen

To apply a plugin interface manually , You will need a method like this, I have left some TODO, where you want to increase the error handling and / or make the implementation a bit more.

  Public listing & lt; T & gt; LoadPlugin & lt; T & gt; (String directory) {type interface type type = type (t); & Lt; T & gt; Implementation = new list & lt; T & gt; (); // TODO: Check to ensure the type, valid foreach (var file in System.IO.Directory.GetFiles (directory)) {// TODO: Include the proper file handle here and / ensure that the files are not. Try vari type in Dll {foreach (system.Reflection.Assembly.LoadFile (file) .GetTypes ()) {if (interfaceType.IsAssignableFrom (type) & InterfaceType! = Type) {// Interface Class Applying Found: / / TODO: Check additional to confirm the interface / pre-specified any //: Make sure that the type is a class, the default constructor etc. Example T = Activator ; Implementations.Add (example); }}} Hold {}} return deployment; }  

Example to call:

  list & lt; IPlugin & gt; Plugins = LoadPlugin & lt; IPlugin & gt; (Path);  

There are a few different ways for the C ++ part of your question that you could contact, though the correct choice depends on your specific situation. You can make a CLR compliant. In Dll, C ++, which can refer to your C # project and call it like any other. Additionally, you can use to call in a native .dll.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -