title: Call class and method from two strings
body: <p>I have a WPF application that has two combo boxes, one with what I'm calling a <code>FileType</code> and one with <code>Actions</code> (add, edit, delete, etc.). Every <code>FileType</code> has a corresponding class. What I'm trying to do is for example if <code>FileTypeA</code> is selected and the action is <code>Add</code> then I want to do something along these lines:</p>
  
  <pre><code>void myMethod(string FileType, string Action)
  {
      //using reflection find class from the FileType string, and call method Action 
      var x = new FileTypeA();
      x.Add();
  }
  </code></pre>
  
  <p>if the user selects <code>FileTypeB</code> and <code>Delete</code> then the object created and the method called will change accordingly. I think this might be possible using reflection, but I'm trying to find out if there is even a better way using perhaps a generic class? since all these <code>FileType</code> classes are very similar.</p>