Hello,
I am building a GUI application that will be the front-end for an XML configuration file.
The XML structure defines a set of object instances. That is, type names, and property values that should be instantiated in the consuming application (windows service).
So there are three layers:
ConfigurationObject <--> ComponentObjects <--> PropertyGrid
The ConfigurationObject
serializes into the proper XML format for the windows service. The ComponentObjects
are the same types that are used by the windows service.
The problem I am having is determining the best way to keep all three layers in sync.
My first implementation I would update individual properties when they were changed. However this approach didnt work very well when I need to update complex objects to the UI (Although I believe I know what the problem was now)
My current approach involves using TypeConverters to convert between the ConfigurationObject
and the ComponentObjects
which works well until a realized that my current logic is ignoring the BrowseableAttribute
(since i simply iterate over all the ComponentObject
properties when converting to a ConfigurationObject
)
So before I spend anymore time on my current approach I want to be sure that I am on the right track. Is there a simpler approach? IS there some model/design pattern I can use in such a situation?
Thanks, Karl