Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Agreed with Thomas Levesque:</p> <p>The following class was correctly saved/read back:</p> <pre><code>public class Foo { public string Name { get; set; } public string MashupString { get; set; } public override string ToString() { return Name; } } </code></pre> <p>Note: I didn't need the <code>SerializableAttribute</code>.</p> <p><strong>Edit:</strong> here is the xml output:</p> <pre><code>&lt;WindowsFormsApplication1.MySettings&gt; &lt;setting name="Foos" serializeAs="Xml"&gt; &lt;value&gt; &lt;ArrayOfFoo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; &lt;Foo&gt; &lt;Name&gt;Hello&lt;/Name&gt; &lt;MashupString&gt;World&lt;/MashupString&gt; &lt;/Foo&gt; &lt;Foo&gt; &lt;Name&gt;Bonjour&lt;/Name&gt; &lt;MashupString&gt;Monde&lt;/MashupString&gt; &lt;/Foo&gt; &lt;/ArrayOfFoo&gt; &lt;/value&gt; &lt;/setting&gt; &lt;/WindowsFormsApplication1.MySettings&gt; </code></pre> <p>And the settings class I used:</p> <pre><code>sealed class MySettings : ApplicationSettingsBase { [UserScopedSetting] public List&lt;Foo&gt; Foos { get { return (List&lt;Foo&gt;)this["Foos"]; } set { this["Foos"] = value; } } } </code></pre> <p>And at last the items I inserted:</p> <pre><code>private MySettings fooSettings = new MySettings(); var list = new List&lt;Foo&gt;() { new Foo() { Name = "Hello", MashupString = "World" }, new Foo() { Name = "Bonjour", MashupString = "Monde" } }; fooSettings.Foos = list; fooSettings.Save(); fooSettings.Reload(); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload