F
fbolefeysot
I have a 'Filter' class that contains some strings, 1 bool and 2 Color
attributes.
I made an array of Filter : Filter[], and I'd like to save this array with
the application settings system.
here is my ApplicationSettingsBase-derived class :
[global::System.Configuration.UserScopedSettingAttribute()]
public Filter[] filtersList
{
get{return ((Filter[])(this["filtersList"])); }
set{ this["filtersList"] = value; }
}
When I call the Save method on this class, it does save my array of Filter
in my user settings, under an XML form, but each saved Filter always have
empty color values, while other Filter strings are ok.
here is a copy of the xml-saved user settings with 1 element in the array :
<setting name="filtersList" serializeAs="Xml">
<value>
<ArrayOfFilter xmlns:xsi="http://www.w3.org/.... ... .."
xmlns:xsd="http://www.w3.org/2001/ .. .. ..">
<Filter>
<name>toto</name>
<pattern>
<string>valeur : 11</string>
</pattern>
<backColor />
<foreColor />
<enabled>true</enabled>
</Filter>
</ArrayOfFilter>
</value>
</setting>
How can I have my custom class completely saved ?
thanks
attributes.
I made an array of Filter : Filter[], and I'd like to save this array with
the application settings system.
here is my ApplicationSettingsBase-derived class :
[global::System.Configuration.UserScopedSettingAttribute()]
public Filter[] filtersList
{
get{return ((Filter[])(this["filtersList"])); }
set{ this["filtersList"] = value; }
}
When I call the Save method on this class, it does save my array of Filter
in my user settings, under an XML form, but each saved Filter always have
empty color values, while other Filter strings are ok.
here is a copy of the xml-saved user settings with 1 element in the array :
<setting name="filtersList" serializeAs="Xml">
<value>
<ArrayOfFilter xmlns:xsi="http://www.w3.org/.... ... .."
xmlns:xsd="http://www.w3.org/2001/ .. .. ..">
<Filter>
<name>toto</name>
<pattern>
<string>valeur : 11</string>
</pattern>
<backColor />
<foreColor />
<enabled>true</enabled>
</Filter>
</ArrayOfFilter>
</value>
</setting>
How can I have my custom class completely saved ?
thanks