title: How to define a "List" of derived classes?
body: <p>I have a base class and some derived classes</p>
  
  <pre><code>public class MyBase {...}
  public class MyClass1 : MyBase {...}
  public class MyClass2 : MyBase {...}
  </code></pre>
  
  <p>Now I want to make a list of these derived classes (classes!! Not instances of classes!), and then I want to create one instance of one of these derived class randomly.</p>
  
  <p>How does this work??</p>
  
  <p>Here what I want in pseudo C# :)</p>
  
  <pre><code>List&lt;MyBase&gt; classList = new List&lt;MyBase&gt; () { MyClass1, MyClass2, MyClass3, ...}
  
  MyBase randomInstance = new classList[random.Next(0,classList.Count-1)]();
  </code></pre>
  
  <p>(unfortunately this List construction expects instances of MyBase but not class names)</p>