title: How to create a collection of classes that can be iterated over?
body: <p>I have a series of properties for an object which are themselves a class:</p>
  
  <pre><code>private ClassThing Thing1;
  private ClassThing Thing2;
  private ClassThing Thing3;
  
  private class ClassThing
  {
      public string Name;
      public int Foos;
  }
  </code></pre>
  
  <p>In some areas I need to be able to access each property specifically, for example:</p>
  
  <pre><code>label1.Text = Thing1.Name;
  </code></pre>
  
  <p>However, it is also desirable to create a foreach loop to access each one, like this:</p>
  
  <pre><code>string CombinedString;
  foreach(ClassThing Thing in SomeCollection)
  {
      CombinedString += Thing.Name;
  }
  </code></pre>
  
  <p><em><strong>The end result must be XML serializable.</em></strong> These examples are very basic, but I hope they more easily demonstrate my need.</p>
  
  <p>I tried creating a dictionary of these properties instead, but a dictionary is not XML serializable. I'd like to simply make all of these properties members of a class that itself can be iterated over, but I'm not sure how.</p>
  
  <p>Can anyone point me in the right direction?</p>