I believe you're missing on type converters. Try to browse the section on
this article of type converters and see if it helps:
http://www.awprofessional.com/articles/printerfriendly.asp?p=169528
Thanks Joey ,
I had read through this document but thought that this was not required for
simple types due to my complete misunderstanding of the DefaultProperty
attribute.
After a little playing around, I couldn't get this to do what I wanted, but
at least I got rid of the ugly component name.
I am displaying some 'friendly' readonly text based on the property's
property values and all value changes are made to the individual properties
of the expanded property.
What I had wanted to do was edit a default property here rather than a
string representing all properties.
I have some further realted questions but will start a new thread for these.
Gerry
> I believe you're missing on type converters. Try to browse the section on
> this article of type converters and see if it helps:
[quoted text clipped - 42 lines]
> > {
> > private readonly Prop prop;
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
> > public Prop Prop
> > {
[quoted text clipped - 5 lines]
> > }
> > }
Ulrich Sprick - 08 Jan 2005 18:31 GMT
Hy gerry,
as joey pointed out, you need a type converter, which is used to convert the
property value (which is an object with its own child properties) into a
string (to be displayed in the property browser) and from string to a new
object.
Override the [Can]ConvertTo() methods to provide the string that you want to
be seen.
Override [Can]ConvertFrom(), specify that you can convert from string type.
Create a new instance of your object in ConvertFrom() in order to return it
later. The value parameter is a string that will only have the information
that you supplied in ConvertTo() above, so you will need to access the other
object properties via TypeDescriptorContext.Instance in order to create a
completely initialized object of your type.
The msdn has a topic "Implementing a Type Converter", which describes it
quite well.
hTH, ulrich.
> Thanks Joey ,
>
[quoted text clipped - 75 lines]
> > > }
> > > }