[MonoDevelop] General purpose Toolbox and PropertyGrid

Michael Hutchinson m.j.hutchinson at gmail.com
Tue Apr 18 12:27:34 EDT 2006


Hi,

On 4/18/06, Lluis Sanchez <lluis at ximian.com> wrote:
> I don't know much about ISelectionService and related stuff, so I can't
> tell if it is possible or not. However, there are some Stetic features

Well, we don't actually need that interface per se, but at least
something that the PropertyGrid can watch for objects. Maybe a service
that anything can push objects into when they are selected?

> which AFAIK are not supported by System.ComponentModel, such as custom
> cell editors (I'm talking about real tree cell editors, not editors
> shown when pressing a button), or hiding/disabling properties depending
> on the values of other properties. How could we fit those features in a
> property grid based on System.ComponentModel?

The cell editor should be easy; the current AspNetEdit grid uses its
own in-grid editor system anyway which I've been planning to port to
TreeView (http://svn.myrealbox.com/viewcvs/trunk/aspeditor/src/propertygrid/AspNetEdit.UI.Editors/).
It can edit most properties of any object; anything that can be
converted to/from a string, collections, objects with child
properties, bools, numbers, enums and colors. There's even an
EventEditor.

Once it's using cell editors it should be 10 minutes' work to get it
to use your editors, simply by hooking into the system it uses to
choose the appropriate editor. The signals pad should not be hard to
reimplement as a tab for the PropertyGrid; after all, I did it for
events.

The relevance of ComponentModel is:

  - notifications of changes to values if performed with a
PropertyDescriptor, so the PropertyGrid can update them. The
PropertyGridService could offer a method to notify it of such changes,
then I can handle the IComponentChangeService at the AspNetEdit level.

  - There are attributes for name, group and description of
properties, an attribute for whether properties should be hidden or
shown, and an attribute for whether to hide properties when multiple
objects are selected (multiple object selection is a very useful
feature). Could Stetic use the same ones? And I could integrate
whatever you use to hide properties based on the values of others?

  - List of objects in designer container, which I use to populate
dropdown list. Another service allows me to update when objects added
to/removed from this list. To be honest, this feature is not
essential, and should probably be replaced with a treeview like you
have in Stetic. This would free up space in the propertygrid pad.

 - Event binding. The EventEditor gets an IEventBindingService from
the selected object through its ComponentModel Site. This service
actually only launches a messagebox and  keeps a list of bound methods
at the moment. My solution would be to have a method on the
PropertyEditorService that could activate the event tab as long as it
is given an IEventBindingService or some equivalent (e.g.your
refactoring services). This would have to be called each time the
selected object changed.

So I think all of these problems could be worked around.


I'm currently planning to write an Summer of Code application either
for this, or for ASP.NET project support and AspNetEdit integration. I
may propose a mixture of the two, but I can't decide exactly what
without knowing what Chris Toshok's status is on the latter. Which
would you prefer to see done first?


Michael


More information about the Monodevelop-list mailing list