C# switch on type
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/298976/c-sharp-is-there-a-better-alternative-than-this-to-switch-on-type">C# - Is there a better alternative than this to &#39;switch on type&#39;?</a>  </p>
</blockquote>



<p>C# doesn't support switching on the type of an object. What is the best pattern of simulating this:</p>

<pre><code>switch (typeof(MyObj))
    case Type1:
    case Type2:
    case Type3:
</code></pre>

<p>Thanks!</p>
