title: C# whats best method of saving dynamically created controls
body: <p>I am currently saving a .net ( c# ) usercontrol to the disk as a XML file by saving each property as an element in the xml document. The file is used for later recreation of the controls at runtime. I am wondering if it is possible or better to save the control as a binary file. There would be many controls so I guess it would have to have a header section describing the location and length of each saved controls. Thoughts?</p>
  
  <p>Brad</p>
  
  <p>BTW this is a windows app</p>
  
  <p>EDIT:</p>
  
  <p>what I currently have inplace is a public member function that uses the propertyDescriptior class to itinerate through all the properties and create an xml document from that.</p>
  
  <pre><code>     PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(this);
  
          for (int i = 0; i &lt;= pdc.Count - 1; i++)
          {   pdc[i].Name
       pdc[i].PropertyType
      pdc[i].Category
  </code></pre>
  
  <p>}</p>
  
  <p>I will look into creating the class Serializable - thanks</p>