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. Plugin Engine (design question)

Plugin Engine (design question)

Scheduled Pinned Locked Moved C#
questiondesignooptutorialannouncement
3 Posts 3 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.
  • M Offline
    M Offline
    MBursill
    wrote on last edited by
    #1

    I am attempting to add plugin support to a program I wrote. I have found many articles on Code Project, each showing how you can create objects from an assembly loaded at runtime. This is great, however, my original design made extensive use of inheritance. Now I'm trying to figure out how I can expose a "parent class" to a plugin. For example: Button inherits from Surface. Surface needs to be something that can be re-written by plugin developers, so that Button will now inherit the version of Surface in the plugin. Can this even be done? -Mike.

    C B 2 Replies Last reply
    0
    • M MBursill

      I am attempting to add plugin support to a program I wrote. I have found many articles on Code Project, each showing how you can create objects from an assembly loaded at runtime. This is great, however, my original design made extensive use of inheritance. Now I'm trying to figure out how I can expose a "parent class" to a plugin. For example: Button inherits from Surface. Surface needs to be something that can be re-written by plugin developers, so that Button will now inherit the version of Surface in the plugin. Can this even be done? -Mike.

      C Offline
      C Offline
      CWIZO
      wrote on last edited by
      #2

      I don't think you can do that (or even want to do that; plugins should have very limited set of functionality avalible to them; inserting them into the core of a aplication is not the best choice...)... But please correct me if I am wrong. -------------------------------------------------------- Q:What does the derived class in C# tell to it's parent? A:All your base are belong to us!

      1 Reply Last reply
      0
      • M MBursill

        I am attempting to add plugin support to a program I wrote. I have found many articles on Code Project, each showing how you can create objects from an assembly loaded at runtime. This is great, however, my original design made extensive use of inheritance. Now I'm trying to figure out how I can expose a "parent class" to a plugin. For example: Button inherits from Surface. Surface needs to be something that can be re-written by plugin developers, so that Button will now inherit the version of Surface in the plugin. Can this even be done? -Mike.

        B Offline
        B Offline
        Bob Stanneveld
        wrote on last edited by
        #3

        Hello, This can be done, although it is not an easy road you want to travel.. Here late binding is not enough, but you also need to create code at runtime. I don't know exactly how to do this. Also several problems arise: what if more than one replacement for the surface class is found? What to do with errors that the plugin might cause? Etc. But I wonder, why do you want to give complete control over your application to some third party? Behind every great black man...             ... is the police. - Conspiracy brother Blog[^]

        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