Plugin Developer Discussion

Discussion for FogBugz Plugin developers

Multiple Classes for each interface possible?

So far all of the examples use one main class to implement all of the different plugin interfaces. I'm not a big fan. Is there a way to separate into multiple classes and tell the api what those classes are?
tracstarr Send private email
Sunday, December 13, 2009
 
 
Hi Tracstarr-

That's a fair objection, but no, right now you would have to write a single Plugin inheritor implementing all of the interfaces you want and then set up routing yourself -- at that point you could re-use the interface definitions in the classes to which you're routing.

Thanks!
Brett Kiefer Send private email
Monday, December 14, 2009
 
 
Thanks. That's what I've been going with.
tracstarr Send private email
Monday, December 14, 2009
 
 
What I do is to create a partial class like this:

MyPlugin.cs --> contains the class main definition with the constructor and the interface references
MyPlugin.PageDisplay.cs --> in this part I'd have the IPluginPageDisplay methods for instance
etc. (you can add as many parts as needed).

You can even have VS dispaly them in a nice nested way in the Solution Explorer, either by hand or by using an addin such as http://blog.laurent.etiemble.com/index.php?post/2006/12/08/101

While this does not really solve the issue of having one class only, it helps a lot to keep more complex plugins better organized and more maintenable (also in regards to source control).
Arsène von Wyss Send private email
Monday, January 4, 2010
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz