H
Helmut Giese
Hello out there,
I am serializing the state of Controls. Now some properties are common
across a wide range but of course there are loads of differences.
I could of course 'switch' on the type and have e.g.
Button: handle Text & TextAlign
Label: handle BorderStyle, Text & TextAlign
Panel: handle BorderStyle
etc.
If on the other hand it were possible to check wether a given Control
posesses a certain property things would be a lot cleaner, like
if (ctrl.HasProperty(Text))
// handle Text & TextAlign for Label & Button
if (ctrl.HasProperty(BorderStyle))
// handle BorderStyle for Label & Panel
etc.
Reflection should make this possible - I feel
Any further info would be greatly appreciated.
Best regards
Helmut Giese
I am serializing the state of Controls. Now some properties are common
across a wide range but of course there are loads of differences.
I could of course 'switch' on the type and have e.g.
Button: handle Text & TextAlign
Label: handle BorderStyle, Text & TextAlign
Panel: handle BorderStyle
etc.
If on the other hand it were possible to check wether a given Control
posesses a certain property things would be a lot cleaner, like
if (ctrl.HasProperty(Text))
// handle Text & TextAlign for Label & Button
if (ctrl.HasProperty(BorderStyle))
// handle BorderStyle for Label & Panel
etc.
Reflection should make this possible - I feel

Any further info would be greatly appreciated.
Best regards
Helmut Giese