Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One approach you could take is to define an interface that contains all the methods that you would like to call from the mother application (called say <code>IMother</code>), and make the mother application implement this.</p> <p>Then you could update <code>IPlugin</code> to have a method like <code>void SetMother( IMother mother )</code> and when you load each plugin you could call this method on the plugin. That way each plugin would have the <code>IMother</code> reference from the beginning and could call methods as necessary.</p> <p>Regarding your question on plugininterface.dll, yes, both MainApplication and myPlugin are dependent on that dll (it is not just needed for development). If you want to avoid using an extra dll (having references to extra dlls isn't generally an issue) I would put the plugin interface in the same project as MainApplication. I'm not sure if I'm understanding your layout though, so if that doesn't answer your question please add more details as to how your projects/solution is configured.</p> <p>EDIT BASED ON COMMENT:</p> <p>I assume your layout is something like the following:<br> One solution file that contains three projects<br> One project for MainApplication<br> One project for myPlugin<br> One project for the plugin interface. </p> <p>You could move the code files for the plugin interface into the MainApplication project. That way MainApplication would not be dependent on anything else. Just take the .cs file from the plugin interface project and add it to MainApplication. You would then need to reference MainApplication from myPlugin, but that should be ok.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload