[c#] Is there a better alternative than this to 'switch on type'?