G
Guest
I have an object which I present to the user through a propertyGrid. With
many of the properties (many of which are objects themselves) I have
implemented my own TypeConverters; many of these inherit from the
ExpandableObjectConverter so that child properties are available to the user.
That all works swell.
Now I'm trying to create a print engine that will be able to print all
properties (Browsable). I thought this was going to be straightforward but I
have hit a snag....
I want to be able to go through the properties of my object and access the
all the child objects and their properties (essentially expanding them for my
print output)
Using the TypeDescriptor.GetProperties() I am able to get a collection of
all the 'first level Properties. I thought that getting at the Child object
properties would be as simple as using the TypeDescriptor.GetConverter()
method. This returns the TypeConvertor but I do not know how to determine if
it is of the expandable variety.
I tried looking at how the property grid accomplishes this but am having
difficulty. It looks like it uses the GetPropertiesSupported() Method on the
TypeDescriptor to determine if the object is expandable. I am trying this by
overriding the GetPropertiesSupported(ITypeDescriptorContext context) method.
However I don't really understand where I get the context from. I need an
example.
If anyone can help it would be appreciated.
many of the properties (many of which are objects themselves) I have
implemented my own TypeConverters; many of these inherit from the
ExpandableObjectConverter so that child properties are available to the user.
That all works swell.
Now I'm trying to create a print engine that will be able to print all
properties (Browsable). I thought this was going to be straightforward but I
have hit a snag....
I want to be able to go through the properties of my object and access the
all the child objects and their properties (essentially expanding them for my
print output)
Using the TypeDescriptor.GetProperties() I am able to get a collection of
all the 'first level Properties. I thought that getting at the Child object
properties would be as simple as using the TypeDescriptor.GetConverter()
method. This returns the TypeConvertor but I do not know how to determine if
it is of the expandable variety.
I tried looking at how the property grid accomplishes this but am having
difficulty. It looks like it uses the GetPropertiesSupported() Method on the
TypeDescriptor to determine if the object is expandable. I am trying this by
overriding the GetPropertiesSupported(ITypeDescriptorContext context) method.
However I don't really understand where I get the context from. I need an
example.
If anyone can help it would be appreciated.