title: How to identify each parameter type in a C# method?
body: <p>I have a C# method say: </p>
  
  <pre><code>MyMethod(int num, string name, Color color, MyComplexType complex)
  </code></pre>
  
  <p>Using reflection, how can I distinctly identify each of the parameter types of any method?
  I want to perform some task by parameter type. If the type is simple int, string or boolean then I do something, if it is Color, XMLDocument, etc I do something else and if it is user defined type like MyComplexType or MyCalci etc then I want to do certain task. </p>
  
  <p>I am able to retrieve all the parameters of a method using ParameterInfo and can loop through each parameter and get their types. But how can I identify each data type?</p>
  
  <pre><code>foreach (var parameter in parameters)
  {
      //identify primitive types??
      //identify value types
      //identify reference types
  
  }
  </code></pre>
  
  <p>Edit: this is apart of my code to create a propert grid sort of page where I want to show the parameter list with data types for the selected method. If the parameter has any userdefined type/reference type then I want to expand it further to show all the elements under it with datatypes.</p>