Type Switch
From http://stackoverflow.com/questions/7252186/switch-case-on-type-c-sharp/7301514#7301514