title: Reflection and autogenerated types
body: <p>I have a class with a single method that uses a "yield" return statement. A nested type is automatically created. Using reflection with binding flags set to <code>BindingFlags.DeclaredOnly</code>, I get this output:  </p>
  
  <blockquote>
    <p>// Public members from my class.<br>
        Test.FileSystemObject..ctor<br>
        Test.FileSystemObject.GetFiles(DirectoryInfo directory)<br>
        Test.FileSystemObject.GetFiles(String path)  </p>
  
  <pre><code>// Auto generated nested class.  
  Test.FileSystemObject+&lt;GetFiles&gt;d__4..ctor  
  Test.FileSystemObject+&lt;GetFiles&gt;d__4.&lt;&gt;3__directory  
  Test.FileSystemObject+&lt;GetFiles&gt;d__4.&lt;&gt;4__this  
  Test.FileSystemObject+&lt;GetFiles&gt;d__4.&lt;directories&gt;5__7  
  Test.FileSystemObject+&lt;GetFiles&gt;d__4.&lt;files&gt;5__8  
  Test.FileSystemObject+&lt;GetFiles&gt;d__4.&lt;FSO&gt;5__6  
  Test.FileSystemObject+&lt;GetFiles&gt;d__4.&lt;i&gt;5__9  
  Test.FileSystemObject+&lt;GetFiles&gt;d__4.&lt;unprocessed&gt;5__5  
  Test.FileSystemObject+&lt;GetFiles&gt;d__4.directory
  </code></pre>
  </blockquote>
  
  <p>How can I determine whether a type returned by <code>assembly.GetTypes(BindingsFlags)</code> is such an auto generated type? I'm looking for a simple way to exclude these.</p>