[MonoDevelop] CodeBehindService, ICodeBehindProvider - no support for partial classes?

Michael Hutchinson m.j.hutchinson at gmail.com
Fri Jul 27 14:21:46 EDT 2007

On 7/26/07, Ivan N. Zlatev <contact at i-nz.net> wrote:
> To me it seems that the current CodeBehindService implementation is
> based on class names and assumes that the code behind file will have a
> different class name than the code-in-front file. What about partial
> classes where the class name will be the same (and the difference will
> be made by filename I suppose)?
> What impact would this have if I want in my WinFormsAddin to have a
> partial class, e.g Form1.cs and Form1.Designer.cs and I want
> Form1.Designer.cs to be the codebehind file and be shown in the
> project treeview as a child of Form1.cs?

This is one of the the next items in my ToDo list.

I have recently adapted the AspNetAddIn to use partial classes, though
I'm also still working out issues with how templates will work with
languages that don't support partial classes. It now needs the
CodeBehindService to handle multiple partial Codebehind classes too.
Also, some CodeBehind is based on filenames instead of classes.

I'm not sure whether the ICodeBehindProvider methods should return
ProjectFiles, filename strings or IClasses (which can specify the
parts of partial classes). The problem is keeping everything updated
properly, as classes can be renamed, go missing, be moved into
different files etc. This is quite tricky to solve (especially in the
context of MonoDevelop's treeview), and doesn't quite work properly at
the moment.

I'm leaning towards something filename based, with perhaps some
utility methods for class names. It was nice to have autodetection of
classes when they disappeared and appeared and were renamed, but it's
probably overkill.

Michael Hutchinson

More information about the Monodevelop-list mailing list