title: C# serialize generic list<customObject> to file
body: <p>i got a class which holds info about pictures, like filepath, hashvalue, bytes.
  in another class i got a generic list where i put objects from the class that holds picture info.</p>
  
  <p>that class looks like this:</p>
  
  <pre><code>[Serializable()]
      class PicInfo : ISerializable
      {
          public string fileName { get; set; }
          public string completeFileName { get; set; }
          public string filePath { get; set; }
          public byte[] hashValue { get; set; }
  
          public PicInfo()
          { }
  
          public PicInfo(SerializationInfo info, StreamingContext ctxt)
          {
              this.fileName = (string)info.GetValue("fileName", typeof(string));
              this.completeFileName = (string)info.GetValue("completeFileName", typeof(string));
              this.filePath = (string)info.GetValue("filePath", typeof(string));
              this.hashValue = (byte[])info.GetValue("hashValue", typeof(byte[]));
          }
  
          public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
          {
              info.AddValue("fileName", this.fileName);
              info.AddValue("completeFileName", this.completeFileName);
              info.AddValue("filePath", this.filePath);
              info.AddValue("hashValue", this.hashValue);
          }
      }
  </code></pre>
  
  <p>my list is just <code>list&lt;picinfo&gt; pi = new list&lt;picinfo&gt;();</code>
  what would be the eaziest way to serialize this list?</p>