title: How to serialize a custom EventHandler
body: <p>Good morning,</p>
  
  <p>I got a class DirObserver with a custom event:</p>
  
  <pre><code>public EventHandler&lt;FileDetectedEventArgs&gt; NewFileDetected;
  </code></pre>
  
  <p>I try to serialize this class in a other class with:</p>
  
  <pre><code>private XmlSerializer serializer = new XmlSerializer(typeof(List&lt;DirObserver&gt;));
  </code></pre>
  
  <p>But i get an exception:  <em>FileDetectedEventArgs cannot be serialized because it does not have a parameterless constructor.</em> </p>
  
  <p>But the FileDetectedEventArgs-Class have a parameterless constructor:</p>
  
  <pre><code>public class FileDetectedEventArgs : EventArgs
  {
      public String Source { get; set; }
      public String Destination { get; set; }
      public String FullName { get; set; }
  
      public FileDetectedEventArgs(String source, String destination, String fullName)
      {
          this.Source = source;
          this.Destination = destination;
          this.FullName = fullName;
      }
  
      public FileDetectedEventArgs() { }
  } 
  </code></pre>
  
  <p>Nevertheless the exception will be raised. Whats the problem here?</p>
  
  <p>Thanks and greets
  Thomas</p>