How to let the application work with plugins?
-
Hi, how can i let my application work with plugins (i mean self-written plugins only for that application). I know i can do this with "Reflection", but how can i work with plugins, which should work on mac, linux and so on? Something like the Widgets/Gadgets in Windows-Sidebar, where i have a file, which is a zip-file where the code and so on is inside? How does something like that works? Has anybody a idea how to do this? Well, i don't want to create a "new programming language" for this plugins, the most plugins like this use javascript, but first, how do i run them? How can i use individual Functions and so on? Thanks
-
Hi, how can i let my application work with plugins (i mean self-written plugins only for that application). I know i can do this with "Reflection", but how can i work with plugins, which should work on mac, linux and so on? Something like the Widgets/Gadgets in Windows-Sidebar, where i have a file, which is a zip-file where the code and so on is inside? How does something like that works? Has anybody a idea how to do this? Well, i don't want to create a "new programming language" for this plugins, the most plugins like this use javascript, but first, how do i run them? How can i use individual Functions and so on? Thanks
the easy way to do this is to add an instance variable of the
WebBrowser
class and let it execute a page containing the JavaScript. See the sample code forWebBrowser.ObjectForScripting
on MSDN: WebBrowser.ObjectForScripting This method works fine as long as you can host theWebBrowser
control inside a form in your application. Regarding the packaging of your plugins, personally I like the widget concept (as I have to deal with it on a daily basis for a project I am working on). A widget is basically a ZIP file with a certain structure and a manifest file. The manifest file (called config.xml if you follow the w3c standards) points to the main HTML file to execute. Let me know if you need more help or want more thoughts regarding this. Cheers, Marcelo-- Marcelo Emmerich Software Development - Computer Graphics - Mobile Computing http://bytethings.blogspot.com
-
the easy way to do this is to add an instance variable of the
WebBrowser
class and let it execute a page containing the JavaScript. See the sample code forWebBrowser.ObjectForScripting
on MSDN: WebBrowser.ObjectForScripting This method works fine as long as you can host theWebBrowser
control inside a form in your application. Regarding the packaging of your plugins, personally I like the widget concept (as I have to deal with it on a daily basis for a project I am working on). A widget is basically a ZIP file with a certain structure and a manifest file. The manifest file (called config.xml if you follow the w3c standards) points to the main HTML file to execute. Let me know if you need more help or want more thoughts regarding this. Cheers, Marcelo-- Marcelo Emmerich Software Development - Computer Graphics - Mobile Computing http://bytethings.blogspot.com
Hi, ok many thanks, but is it possible not to work with the WebBrowser-Object? Maybe with HTMLDocument or an other System like WebKit or else? And is it maybe possible to start events from a object in the HTML from my code? I mean, if i click a button in my Application, i want that the HTML-Page is running a specified js-function.
-
Hi, ok many thanks, but is it possible not to work with the WebBrowser-Object? Maybe with HTMLDocument or an other System like WebKit or else? And is it maybe possible to start events from a object in the HTML from my code? I mean, if i click a button in my Application, i want that the HTML-Page is running a specified js-function.
Another idea!... is it possible to embed the javascript-files, classes and so on into my own project? i mean, that they use my classes and functions and i can use their functions, classes, objects and so on?