title: Class design problem - passing a class type?
body: <p>I have the following code in a method of a class:</p>
  
  <pre><code>XmlSerializer serializer = new XmlSerializer(typeof(FooClass));
  </code></pre>
  
  <p>How do I pass into the constructor or a parameter of the class - the foo class?  </p>
  
  <p>I think it has something to do with reflection as you can't pass as a parameter just a class name - so the following code makes some sort of sense (thanks to Aidan) - </p>
  
  <pre><code>XmlSerializer serializer = new XmlSerializer(Type.GetType("namespace.FooClass"));
  </code></pre>