Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PlugIn accessing master project class

Status
Not open for further replies.

Julesey

Programmer
Oct 24, 2006
6
GB
Hi all,

I'm fairly new to c# and vs so I hope this question isn't an obvious one.

I have written a project but have then decided to segment parts of the code into PlugIn components.

My question is what is the best way to access parts of the parent code from the PlugIn e.g. the Dataaccess area that's part of the main app.

I can add the files to the Plugin project but this merely copies the files to the PlugIn proj directory. The bits of code I need are compiled into App_Code

thank you :)
 
Look at Interfaces.

Basically, you pass your plugin a class that implements an interface (the interface should be in the plugin project or in a separate project used by many plugins.

Once you pass in the interface class the plugin can use the functionality of it.

Hope that gets you started.
 
Thanks JM,
I already have the interface in place and being used by Host and Plug-In. I think I found the answer tho which is to break out the App_Code stuff into its own project so that I can compile the dll straight from that and then just access that both from the Plug-In and the main app.

cheers
Julesey
 
That is good if your plug-ins are allowed to be aware of that section of code. Otherwise you are exposing too much to the rest of the world.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top