title: how to make a new object of an type variable in a Dictionary if the type has constructor arguments c#
body: <pre><code>class baseClass
  {         
      public baseClass(int x,int y) {}
  }
  class class1 : baseClass
  {    
      public class1(int x,int y) : base (x,y) {}
  }
  public void Main()
  {
  
      Dictionery&lt;int,Type&gt; classes = new Dictionery&lt;int,Type&gt;();
      classes.add(1,typeof(Class1));
  
      baseClass x = new classes[1] (10 , 12); // doesent work
  
      //tried
      baseClass x = Activator.CreateInstanceFrom(classes[2](10, 12))
      //tried
      baseClass x = Activator.CreateInstanceFrom(classes[2], 10, 12)
  }
  </code></pre>
  
  <p>i found this post : <a href="https://stackoverflow.com/questions/13188784/store-class-definition-in-dictionary-instance-later">Store class definition in dictionary, instance later</a></p>
  
  <p>and an anwser saying :  If your types have constructors that take the same arguments, you can add the arguments after dict["A"]</p>
  
  <p>but then, how is the syntax to do that ? </p>
  
  <p>I would just leave a comment on the post but i don't gott the reputation to do so... :/</p>