When would you use switching on type? Most of the cases I can think of are better solved with inheritance, i.e. rather than doing:
switch (typeof(MyObj)) {
case Type1: doSomethingForType1; break;
case Type2: doSomethingForType2; break;
case Type3: doSomethingForType3; break;
You would set it up in a much more object-oriented manner:
Interface ISpecialType {
void doSomething();
}
Type1 : ISpecialType {
doSomething() {}
}
Type2 : ISpecialType {
doSomething() {}
}
Type3 : ISpecialType {
doSomething() {}
}
then, no matter what, you just call MyObj.doSomething();
It's a little bit more typing at the start, but a lot more robust.
Also, if it's really important to you to switch on, you can always use typeof(MyObj).toString() and switch on that. It's not recommended practice, since you're then hard-coding strings that are allowed to change into your switch, but you can do it.