title: How to get a list of the class members (fields and properties) and their values?
body: <p>I have found one solution for this but it seems not working for me(
  (CrazyCasta answer):</p>
  
  <p><a href="https://stackoverflow.com/questions/12680341/how-to-get-both-fields-and-properties-in-single-call-via-reflection">how to get both fields and properties in single call via reflection?</a></p>
  
  <p>As I have told before I have used the code of CrazyCasta:</p>
  
  <pre><code>interface IGetSettable
  {
      public void SetValue(
          Object obj,
          Object value,
          Object[] index);
  
      public Object GetValue(
          Object obj,
          Object[] index);
  }
  
  public class ParameterInfoGS : IGetSettable
  {
      protected ParameterInfo pi;
  
      public ParameterInfoExtra(ParameterInfo _pi)
      {
          pi = _pi;
      }
  
      public void SetValue(
          Object obj,
          Object value,
          Object[] index) { pi.SetValue(obj, value, index); }
  
      public Object GetValue(
          Object obj,
          Object[] index) { return pi.GetValue(obj, index); }
  }
  
  public class FieldInfoGS : IGetSettable
  {
      protected FieldInfo pi;
  
      public FieldInfoExtra(FieldInfo _pi)
      {
          pi = _pi;
      }
  
      public void SetValue(
          Object obj,
          Object value,
          Object[] index) {pi.SetValue(obj, value, index);}
      public Object GetValue(
          Object obj,
          Object[] index) {return pi.GetValue(obj, index);}
  }
  
  public static class AssemblyExtension
  {
      public static IGetSettable[] GetParametersAndFields(this Type t)
      {
          List&lt;IGetSettable&gt; retList = new List&lt;IGetSettable&gt;();
  
          foreach(ParameterInfo pi in t.GetParameters())
              retList.Add(new ParameterInfoExtra(pi));
  
          foreach(FieldInfo fi in t.GetFields())
              retList.Add(new FieldInfoExtra(fi));
  
          return retList.ToArray();
      }
  }
  </code></pre>
  
  <p>I have get a number of errors like ParameterInfo does not contains any GetValue SetValue methods</p>