Should I store the type of an inherited class as its property rather than use `as` or `is`?
<p>say, if I want to intensively test the type of some inherited class, and good performance is desired, should I use <code>enum</code> store all possible types, and use enum equality to test the type instead of using <code>is</code>.</p>

<p>e.g.</p>

<pre><code>switch (myObject.Type)
      {
      case myType.type1:
                 myObject as myInheritedObject1;
                 ...
                 break;
      case myType.type2:
                 myObject as myInheritedObject2;
                 ...
                 break;
      case myType.type3:
                 myObject as myInheritedObject3;
                 ...
                 break;
         ...
     }
</code></pre>

<p>or</p>

<pre><code>    var tmp = myObject as myInheritedObject1;
    if (tmp != null)
      {
      }
    else 
      {
        tmp = myObject as myInheritedObject2;
        if (tmp != null)
        {
        }
          else 
            {
             tmp = myObject as myInheritedObject3;
             if (tmp != null)
             {
             }
      }   }}
</code></pre>
