R
rob
Using the settings editor I am trying to add a setting whose type is a
custom type. In a first approach I tried a class marked as
[Serializable]. But then when I try to get the property the way shown
bellow I get null returned.
MyProperties prop = Properties.Settings.Default.MyProp
Assuming prop is null because MyProperties is not a value type I
changed MyProperties from a class to a struct. Unfortunately, settings
editor does not allow me to add a struct giving me the following error:
"There was an error generating the xml document"
Can a value type not be serialized or what is going on here?
In any case, how can I add custom types to the application settings?
Thanks
custom type. In a first approach I tried a class marked as
[Serializable]. But then when I try to get the property the way shown
bellow I get null returned.
MyProperties prop = Properties.Settings.Default.MyProp
Assuming prop is null because MyProperties is not a value type I
changed MyProperties from a class to a struct. Unfortunately, settings
editor does not allow me to add a struct giving me the following error:
"There was an error generating the xml document"
Can a value type not be serialized or what is going on here?
In any case, how can I add custom types to the application settings?
Thanks