Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to let the application work with plugins?

How to let the application work with plugins?

Scheduled Pinned Locked Moved C#
questionjavascriptlinuxtutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    softwarejaeger
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • S softwarejaeger

      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

      M Offline
      M Offline
      Marcelo Emmerich
      wrote on last edited by
      #2

      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 for WebBrowser.ObjectForScripting on MSDN: WebBrowser.ObjectForScripting This method works fine as long as you can host the WebBrowser 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

      S 1 Reply Last reply
      0
      • M Marcelo Emmerich

        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 for WebBrowser.ObjectForScripting on MSDN: WebBrowser.ObjectForScripting This method works fine as long as you can host the WebBrowser 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

        S Offline
        S Offline
        softwarejaeger
        wrote on last edited by
        #3

        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.

        S 1 Reply Last reply
        0
        • S softwarejaeger

          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.

          S Offline
          S Offline
          softwarejaeger
          wrote on last edited by
          #4

          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?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups