title: Check if Object is Dictionary or List
body: <p>Working with .NET 2 in mono, I'm using a basic <code>JSON</code> library that returns nested string, object Dictionary and lists.</p>
  
  <p>I'm writing a mapper to map this to a jsonData class that I already have and I need to be able to determine if the underlying type of an <code>object</code> is a Dictionary or a List. Below is the method I'm using to perform this test, but was wondering if theres a cleaner way?</p>
  
  <pre><code>private static bool IsDictionary(object o) {
      try {
          Dictionary&lt;string, object&gt; dict = (Dictionary&lt;string, object&gt;)o;
          return true;
      } catch {
          return false;
      }
  }
  
  private static bool IsList(object o) {
      try {
          List&lt;object&gt; list = (List&lt;object&gt;)o;
          return true;
      } catch {
          return false;
      }
  }
  </code></pre>
  
  <p>The library I'm using is <code>litJson</code> but the <code>JsonMapper</code> class essentially doesn't work on iOS, hence the reason I am writing my own mapper.</p>