Posted 16 years ago
by jeff jarrell
I am implementing a Factory that inherits from DataFactory. I override the method called GetProperties that provides the list of properties. Now the properties need to be assembled into categories.
So there is an override that returns a List of IDataAccessors. Without doing anything, I get the Misc category with all the properties assembled in the Misc(ICategoryDataAccessor). Accessors collection.
It appears that inheriting DataFactory doesn't really support categories or if it does, how does the property get associated with the category? The IPropertyDataAccessor does have a 'string category but it is only a getter, what does this mean. On the ICategoryDataAccessor there isn't much in this interface to make the link.
Taking another tack, I could just implement IDataFactory and provide an implementation for GetDataAccessors, create the categories and then painstaking assemble the properties underneath the proper category using ICategoryDataAccessor.Accessors collection.
It seems like I should be able to provide my collection of categories and then on each property set a reference of some sort to the category and then let the PropertyGrid sort it out. (This is really the main question, where am I off?)
One other question, is there value to inheriting from CachedPropertyDataAccessorBase for the PropertyDataAccessors. These objects are re-created each time on a SelectedObject(s) so I don't know what can be cached.
Appreciate any comments.
Thanks, jeff
So there is an override that returns a List of IDataAccessors. Without doing anything, I get the Misc category with all the properties assembled in the Misc(ICategoryDataAccessor). Accessors collection.
It appears that inheriting DataFactory doesn't really support categories or if it does, how does the property get associated with the category? The IPropertyDataAccessor does have a 'string category but it is only a getter, what does this mean. On the ICategoryDataAccessor there isn't much in this interface to make the link.
Taking another tack, I could just implement IDataFactory and provide an implementation for GetDataAccessors, create the categories and then painstaking assemble the properties underneath the proper category using ICategoryDataAccessor.Accessors collection.
It seems like I should be able to provide my collection of categories and then on each property set a reference of some sort to the category and then let the PropertyGrid sort it out. (This is really the main question, where am I off?)
One other question, is there value to inheriting from CachedPropertyDataAccessorBase for the PropertyDataAccessors. These objects are re-created each time on a SelectedObject(s) so I don't know what can be cached.
Appreciate any comments.
Thanks, jeff